Class SqmJsonExistsExpression
java.lang.Object
org.hibernate.query.sqm.tree.AbstractSqmNode
org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement<T>
org.hibernate.query.sqm.tree.jpa.AbstractJpaSelection<T>
org.hibernate.query.sqm.tree.expression.AbstractSqmExpression<T>
org.hibernate.query.sqm.tree.expression.SqmFunction<T>
org.hibernate.query.sqm.function.SelfRenderingSqmFunction<T>
org.hibernate.query.sqm.tree.expression.AbstractSqmJsonPathExpression<Boolean>
org.hibernate.query.sqm.tree.expression.SqmJsonExistsExpression
- All Implemented Interfaces:
Expression<Boolean>
,Selection<Boolean>
,TupleElement<Boolean>
,Serializable
,JpaCriteriaNode
,JpaExpression<Boolean>
,JpaFunction<Boolean>
,JpaJsonExistsExpression
,JpaJsonExistsNode
,JpaSelection<Boolean>
,JpaTupleElement<Boolean>
,SemanticPathPart
,SqmExpression<Boolean>
,SqmSelectableNode<Boolean>
,SqmExpressibleAccessor<Boolean>
,SqmNode
,SqmTypedNode<Boolean>
,SqmVisitableNode
@Incubating
public class SqmJsonExistsExpression
extends AbstractSqmJsonPathExpression<Boolean>
implements JpaJsonExistsExpression
Special expression for the json_exists function that also captures special syntax elements like error behavior and passing variables.
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.query.criteria.JpaJsonExistsNode
JpaJsonExistsNode.ErrorBehavior
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmJsonExistsExpression
(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<Boolean> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertToSqlAst
(SqmToSqlAstConverter walker) copy
(SqmCopyContext context) Sets theJpaJsonExistsNode.ErrorBehavior.ERROR
for this json exists expression.Sets theJpaJsonExistsNode.ErrorBehavior.FALSE
for this json exists expression.Get theJpaJsonExistsNode.ErrorBehavior
of this json exists expression.passing
(String parameterName, Expression<?> expression) Passes the givenExpression
as value for the parameter with the given name in the JSON path.Sets theJpaJsonExistsNode.ErrorBehavior.TRUE
for this json exists expression.Sets theJpaJsonExistsNode.ErrorBehavior.UNSPECIFIED
for this json exists expression.Methods inherited from class org.hibernate.query.sqm.tree.expression.AbstractSqmJsonPathExpression
addPassingExpression, appendPassingExpressionHqlString, copyPassingExpressions, createJsonPathPassingClause, getPassingExpressions
Methods inherited from class org.hibernate.query.sqm.function.SelfRenderingSqmFunction
determineResultType, getArgumentsValidator, getFunctionRenderer, getImpliedResultType, getMappingModelExpressible, getNodeType, getReturnTypeResolver, resolveResultType, resolveSqlAstArguments
Methods inherited from class org.hibernate.query.sqm.tree.expression.SqmFunction
accept, getArguments, getFunctionDescriptor, getFunctionName, resolveIndexedAccess, resolvePathPart
Methods inherited from class org.hibernate.query.sqm.tree.expression.AbstractSqmExpression
applyInferableType, as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, cast, equalTo, equalTo, getJavaTypeDescriptor, in, in, in, in, internalApplyInferableType, isNotNull, isNull, nodeBuilder, notEqualTo, notEqualTo
Methods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaSelection
alias, getSelectionItems, isCompoundSelection
Methods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement
copyTo, getAlias, setAlias, setExpressibleType
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.hibernate.query.criteria.JpaSelection
alias, getCompoundSelectionItems, getSelectionItems
Methods inherited from interface org.hibernate.query.criteria.JpaTupleElement
getJavaType, getJavaTypeDescriptor, getJavaTypeName, isEnum
Methods inherited from interface jakarta.persistence.criteria.Selection
isCompoundSelection
Methods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
castAs, visitSubSelectableNodes
Methods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText
Methods inherited from interface org.hibernate.query.sqm.tree.select.SqmSelectableNode
getTupleLength
Methods inherited from interface org.hibernate.query.sqm.tree.SqmTypedNode
getExpressible, getNodeJavaType
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
toHqlString
Methods inherited from interface jakarta.persistence.TupleElement
getAlias
-
Constructor Details
-
SqmJsonExistsExpression
public SqmJsonExistsExpression(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<Boolean> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name)
-
-
Method Details
-
copy
- Specified by:
copy
in interfaceSqmExpression<Boolean>
- Specified by:
copy
in interfaceSqmNode
- Specified by:
copy
in interfaceSqmSelectableNode<Boolean>
- Specified by:
copy
in interfaceSqmTypedNode<Boolean>
- Overrides:
copy
in classSelfRenderingSqmFunction<Boolean>
-
getErrorBehavior
Description copied from interface:JpaJsonExistsNode
Get theJpaJsonExistsNode.ErrorBehavior
of this json exists expression.- Specified by:
getErrorBehavior
in interfaceJpaJsonExistsNode
- Returns:
- the error behavior
-
unspecifiedOnError
Description copied from interface:JpaJsonExistsNode
Sets theJpaJsonExistsNode.ErrorBehavior.UNSPECIFIED
for this json exists expression.- Specified by:
unspecifiedOnError
in interfaceJpaJsonExistsExpression
- Specified by:
unspecifiedOnError
in interfaceJpaJsonExistsNode
- Returns:
this
for method chaining
-
errorOnError
Description copied from interface:JpaJsonExistsNode
Sets theJpaJsonExistsNode.ErrorBehavior.ERROR
for this json exists expression.- Specified by:
errorOnError
in interfaceJpaJsonExistsExpression
- Specified by:
errorOnError
in interfaceJpaJsonExistsNode
- Returns:
this
for method chaining
-
trueOnError
Description copied from interface:JpaJsonExistsNode
Sets theJpaJsonExistsNode.ErrorBehavior.TRUE
for this json exists expression.- Specified by:
trueOnError
in interfaceJpaJsonExistsExpression
- Specified by:
trueOnError
in interfaceJpaJsonExistsNode
- Returns:
this
for method chaining
-
falseOnError
Description copied from interface:JpaJsonExistsNode
Sets theJpaJsonExistsNode.ErrorBehavior.FALSE
for this json exists expression.- Specified by:
falseOnError
in interfaceJpaJsonExistsExpression
- Specified by:
falseOnError
in interfaceJpaJsonExistsNode
- Returns:
this
for method chaining
-
passing
Description copied from interface:JpaJsonExistsExpression
Passes the givenExpression
as value for the parameter with the given name in the JSON path.- Specified by:
passing
in interfaceJpaJsonExistsExpression
- Returns:
this
for method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAst
in classSelfRenderingSqmFunction<Boolean>
-
appendHqlString
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
- Overrides:
appendHqlString
in classSqmFunction<Boolean>
-