Class SqmJsonExistsExpression
java.lang.Object
org.hibernate.query.sqm.tree.spi.AbstractSqmNode
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaTupleElement<Boolean>
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaSelection<Boolean>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmExpression<Boolean>
org.hibernate.query.sqm.tree.spi.expression.SqmFunction<Boolean>
org.hibernate.query.sqm.function.SelfRenderingSqmFunction<Boolean>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmJsonPathExpression<Boolean>
org.hibernate.query.sqm.tree.spi.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>, SqmCacheable, SqmExpressibleAccessor<Boolean>, SqmNode, SqmTypedNode<Boolean>, SqmVisitableNode
@Incubating(since="6.2")
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 JpaJsonExistsNode
JpaJsonExistsNode.ErrorBehavior -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmJsonExistsExpression(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, ReturnableType<Boolean> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendHqlString(StringBuilder hql, SqmRenderContext context) intconvertToSqlAst(SqmToSqlAstConverter walker) copy(SqmCopyContext context) booleanUse the JSON error behavior that raises an error.Use the JSON error behavior that returns false.Get theJpaJsonExistsNode.ErrorBehaviorof this json exists expression.inthashCode()booleanisCompatible(Object other) passing(String parameterName, Expression<?> expression) Passes the givenExpressionas value for the parameter with the given name in the JSON path.Use the JSON error behavior that returns true.Use the unspecified JSON error behavior.Methods inherited from class AbstractSqmJsonPathExpression
addPassingExpression, appendPassingExpressionHqlString, copyPassingExpressions, createJsonPathPassingClause, getPassingExpressionsMethods inherited from class SelfRenderingSqmFunction
determineResultType, getArgumentsValidator, getFunctionRenderer, getImpliedResultType, getMappingModelExpressible, getNodeType, getReturnTypeResolver, resolveResultType, resolveSqlAstArgumentsMethods inherited from class SqmFunction
accept, getArguments, getFunctionDescriptor, getFunctionName, resolveIndexedAccess, resolvePathPartMethods inherited from class AbstractSqmExpression
applyInferableType, as, cast, coalesce, coalesce, count, countDistinct, equalTo, equalTo, getJavaTypeDescriptor, in, in, in, in, in, internalApplyInferableType, isMember, isNotMember, isNotNull, isNull, nodeBuilder, notEqualTo, notEqualTo, nullif, nullif, selectCase, selectCaseMethods inherited from class AbstractJpaSelection
alias, getSelectionItems, isCompoundSelectionMethods inherited from class AbstractJpaTupleElement
copyTo, getAlias, setAlias, setExpressibleTypeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface JpaExpression
coalesce, coalesce, count, countDistinct, in, isMember, isNotMember, nullif, nullif, selectCase, selectCaseMethods inherited from interface JpaSelection
alias, getCompoundSelectionItems, getSelectionItemsMethods inherited from interface JpaTupleElement
getJavaType, getJavaTypeDescriptor, getJavaTypeIfKnown, getJavaTypeName, isEnumMethods inherited from interface Selection
isCompoundSelectionMethods inherited from interface SqmExpression
asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, castAs, visitSubSelectableNodesMethods inherited from interface SqmNode
asLoggableTextMethods inherited from interface SqmSelectableNode
getTupleLengthMethods inherited from interface SqmTypedNode
getExpressible, getNodeJavaTypeMethods inherited from interface SqmVisitableNode
toHqlStringMethods inherited from interface TupleElement
getAlias
-
Constructor Details
-
SqmJsonExistsExpression
public SqmJsonExistsExpression(@Nonnull SqmFunctionDescriptor descriptor, @Nonnull FunctionRenderer renderer, @Nonnull List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<Boolean> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, @Nonnull FunctionReturnTypeResolver returnTypeResolver, @Nonnull NodeBuilder nodeBuilder, @Nonnull String name)
-
-
Method Details
-
copy
- Specified by:
copyin interfaceSqmExpression<Boolean>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<Boolean>- Specified by:
copyin interfaceSqmTypedNode<Boolean>- Overrides:
copyin classSelfRenderingSqmFunction<Boolean>
-
getErrorBehavior
Description copied from interface:JpaJsonExistsNodeGet theJpaJsonExistsNode.ErrorBehaviorof this json exists expression.- Specified by:
getErrorBehaviorin interfaceJpaJsonExistsNode- Returns:
- the error behavior
-
unspecifiedOnError
Description copied from interface:JpaJsonExistsExpressionUse the unspecified JSON error behavior.- Specified by:
unspecifiedOnErrorin interfaceJpaJsonExistsExpression- Specified by:
unspecifiedOnErrorin interfaceJpaJsonExistsNode- Returns:
thisfor method chaining
-
errorOnError
Description copied from interface:JpaJsonExistsExpressionUse the JSON error behavior that raises an error.- Specified by:
errorOnErrorin interfaceJpaJsonExistsExpression- Specified by:
errorOnErrorin interfaceJpaJsonExistsNode- Returns:
thisfor method chaining
-
trueOnError
Description copied from interface:JpaJsonExistsExpressionUse the JSON error behavior that returns true.- Specified by:
trueOnErrorin interfaceJpaJsonExistsExpression- Specified by:
trueOnErrorin interfaceJpaJsonExistsNode- Returns:
thisfor method chaining
-
falseOnError
Description copied from interface:JpaJsonExistsExpressionUse the JSON error behavior that returns false.- Specified by:
falseOnErrorin interfaceJpaJsonExistsExpression- Specified by:
falseOnErrorin interfaceJpaJsonExistsNode- Returns:
thisfor method chaining
-
passing
@Nonnull public SqmJsonExistsExpression passing(@Nonnull String parameterName, @Nonnull Expression<?> expression) Description copied from interface:JpaJsonExistsExpressionPasses the givenExpressionas value for the parameter with the given name in the JSON path.- Specified by:
passingin interfaceJpaJsonExistsExpression- Returns:
thisfor method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAstin classSelfRenderingSqmFunction<Boolean>
-
appendHqlString
- Specified by:
appendHqlStringin interfaceSqmVisitableNode- Overrides:
appendHqlStringin classSqmFunction<Boolean>
-
equals
- Overrides:
equalsin classAbstractSqmJsonPathExpression<Boolean>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractSqmJsonPathExpression<Boolean>
-
isCompatible
- Specified by:
isCompatiblein interfaceSqmCacheable- Overrides:
isCompatiblein classAbstractSqmJsonPathExpression<Boolean>
-
cacheHashCode
public int cacheHashCode()- Specified by:
cacheHashCodein interfaceSqmCacheable- Overrides:
cacheHashCodein classAbstractSqmJsonPathExpression<Boolean>
-