Class SqmJsonQueryExpression
java.lang.Object
org.hibernate.query.sqm.tree.spi.AbstractSqmNode
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaTupleElement<String>
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaSelection<String>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmExpression<String>
org.hibernate.query.sqm.tree.spi.expression.SqmFunction<String>
org.hibernate.query.sqm.function.SelfRenderingSqmFunction<String>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmJsonPathExpression<String>
org.hibernate.query.sqm.tree.spi.expression.SqmJsonQueryExpression
- All Implemented Interfaces:
Expression<String>, Selection<String>, TupleElement<String>, Serializable, JpaCriteriaNode, JpaExpression<String>, JpaFunction<String>, JpaJsonQueryExpression, JpaJsonQueryNode, JpaSelection<String>, JpaTupleElement<String>, SemanticPathPart, SqmExpression<String>, SqmSelectableNode<String>, SqmCacheable, SqmExpressibleAccessor<String>, SqmNode, SqmTypedNode<String>, SqmVisitableNode
@Incubating(since="6.2")
public class SqmJsonQueryExpression
extends AbstractSqmJsonPathExpression<String>
implements JpaJsonQueryExpression
Special expression for the json_query function that also captures special syntax elements like error and empty behavior.
- Since:
- 7.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface JpaJsonQueryNode
JpaJsonQueryNode.EmptyBehavior, JpaJsonQueryNode.ErrorBehavior, JpaJsonQueryNode.WrapMode -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmJsonQueryExpression(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, ReturnableType<String> impliedResultType, ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendHqlString(StringBuilder hql, SqmRenderContext context) intconvertToSqlAst(SqmToSqlAstConverter walker) copy(SqmCopyContext context) Use the JSON empty behavior that returns an empty array.Use the JSON error behavior that returns an empty array.Use the JSON empty behavior that returns an empty object.Use the JSON error behavior that returns an empty object.booleanUse the JSON empty behavior that raises an error.Use the JSON error behavior that raises an error.Get theJpaJsonQueryNode.EmptyBehaviorof this json query expression.Get theJpaJsonQueryNode.ErrorBehaviorof this json query expression.Get theJpaJsonQueryNode.WrapModeof this json query expression.inthashCode()booleanisCompatible(Object other) Use the JSON empty behavior that returns null.Use the JSON error behavior that returns null.passing(String parameterName, Expression<?> expression) Passes the givenExpressionas value for the parameter with the given name in the JSON path.Use the unspecified JSON empty behavior.Use the unspecified JSON error behavior.Use the unspecified JSON query wrapper mode.Use the JSON query wrapper mode with a conditional wrapper.Use the JSON query wrapper mode without a wrapper.Use the JSON query wrapper mode with a wrapper.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
-
SqmJsonQueryExpression
public SqmJsonQueryExpression(@Nonnull SqmFunctionDescriptor descriptor, @Nonnull FunctionRenderer renderer, @Nonnull List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<String> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, @Nonnull FunctionReturnTypeResolver returnTypeResolver, @Nonnull NodeBuilder nodeBuilder, @Nonnull String name)
-
-
Method Details
-
copy
- Specified by:
copyin interfaceSqmExpression<String>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<String>- Specified by:
copyin interfaceSqmTypedNode<String>- Overrides:
copyin classSelfRenderingSqmFunction<String>
-
getWrapMode
Description copied from interface:JpaJsonQueryNodeGet theJpaJsonQueryNode.WrapModeof this json query expression.- Specified by:
getWrapModein interfaceJpaJsonQueryNode- Returns:
- the wrap mode
-
getErrorBehavior
Description copied from interface:JpaJsonQueryNodeGet theJpaJsonQueryNode.ErrorBehaviorof this json query expression.- Specified by:
getErrorBehaviorin interfaceJpaJsonQueryNode- Returns:
- the error behavior
-
getEmptyBehavior
Description copied from interface:JpaJsonQueryNodeGet theJpaJsonQueryNode.EmptyBehaviorof this json query expression.- Specified by:
getEmptyBehaviorin interfaceJpaJsonQueryNode- Returns:
- the empty behavior
-
withoutWrapper
Description copied from interface:JpaJsonQueryExpressionUse the JSON query wrapper mode without a wrapper.- Specified by:
withoutWrapperin interfaceJpaJsonQueryExpression- Specified by:
withoutWrapperin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
withWrapper
Description copied from interface:JpaJsonQueryExpressionUse the JSON query wrapper mode with a wrapper.- Specified by:
withWrapperin interfaceJpaJsonQueryExpression- Specified by:
withWrapperin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
withConditionalWrapper
Description copied from interface:JpaJsonQueryExpressionUse the JSON query wrapper mode with a conditional wrapper.- Specified by:
withConditionalWrapperin interfaceJpaJsonQueryExpression- Specified by:
withConditionalWrapperin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
unspecifiedWrapper
Description copied from interface:JpaJsonQueryExpressionUse the unspecified JSON query wrapper mode.- Specified by:
unspecifiedWrapperin interfaceJpaJsonQueryExpression- Specified by:
unspecifiedWrapperin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
unspecifiedOnError
Description copied from interface:JpaJsonQueryExpressionUse the unspecified JSON error behavior.- Specified by:
unspecifiedOnErrorin interfaceJpaJsonQueryExpression- Specified by:
unspecifiedOnErrorin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
errorOnError
Description copied from interface:JpaJsonQueryExpressionUse the JSON error behavior that raises an error.- Specified by:
errorOnErrorin interfaceJpaJsonQueryExpression- Specified by:
errorOnErrorin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
nullOnError
Description copied from interface:JpaJsonQueryExpressionUse the JSON error behavior that returns null.- Specified by:
nullOnErrorin interfaceJpaJsonQueryExpression- Specified by:
nullOnErrorin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
emptyArrayOnError
Description copied from interface:JpaJsonQueryExpressionUse the JSON error behavior that returns an empty array.- Specified by:
emptyArrayOnErrorin interfaceJpaJsonQueryExpression- Specified by:
emptyArrayOnErrorin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
emptyObjectOnError
Description copied from interface:JpaJsonQueryExpressionUse the JSON error behavior that returns an empty object.- Specified by:
emptyObjectOnErrorin interfaceJpaJsonQueryExpression- Specified by:
emptyObjectOnErrorin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
unspecifiedOnEmpty
Description copied from interface:JpaJsonQueryExpressionUse the unspecified JSON empty behavior.- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonQueryExpression- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
errorOnEmpty
Description copied from interface:JpaJsonQueryExpressionUse the JSON empty behavior that raises an error.- Specified by:
errorOnEmptyin interfaceJpaJsonQueryExpression- Specified by:
errorOnEmptyin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
nullOnEmpty
Description copied from interface:JpaJsonQueryExpressionUse the JSON empty behavior that returns null.- Specified by:
nullOnEmptyin interfaceJpaJsonQueryExpression- Specified by:
nullOnEmptyin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
emptyArrayOnEmpty
Description copied from interface:JpaJsonQueryExpressionUse the JSON empty behavior that returns an empty array.- Specified by:
emptyArrayOnEmptyin interfaceJpaJsonQueryExpression- Specified by:
emptyArrayOnEmptyin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
emptyObjectOnEmpty
Description copied from interface:JpaJsonQueryExpressionUse the JSON empty behavior that returns an empty object.- Specified by:
emptyObjectOnEmptyin interfaceJpaJsonQueryExpression- Specified by:
emptyObjectOnEmptyin interfaceJpaJsonQueryNode- Returns:
thisfor method chaining
-
passing
@Nonnull public SqmJsonQueryExpression passing(@Nonnull String parameterName, @Nonnull Expression<?> expression) Description copied from interface:JpaJsonQueryExpressionPasses the givenExpressionas value for the parameter with the given name in the JSON path.- Specified by:
passingin interfaceJpaJsonQueryExpression- Returns:
thisfor method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAstin classSelfRenderingSqmFunction<String>
-
appendHqlString
- Specified by:
appendHqlStringin interfaceSqmVisitableNode- Overrides:
appendHqlStringin classSqmFunction<String>
-
equals
- Overrides:
equalsin classAbstractSqmJsonPathExpression<String>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractSqmJsonPathExpression<String>
-
isCompatible
- Specified by:
isCompatiblein interfaceSqmCacheable- Overrides:
isCompatiblein classAbstractSqmJsonPathExpression<String>
-
cacheHashCode
public int cacheHashCode()- Specified by:
cacheHashCodein interfaceSqmCacheable- Overrides:
cacheHashCodein classAbstractSqmJsonPathExpression<String>
-