Class SqmJsonQueryExpression
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<String>
org.hibernate.query.sqm.tree.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>
,SqmExpressibleAccessor<String>
,SqmNode
,SqmTypedNode<String>
,SqmVisitableNode
@Incubating
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 org.hibernate.query.criteria.JpaJsonQueryNode
JpaJsonQueryNode.EmptyBehavior, JpaJsonQueryNode.ErrorBehavior, JpaJsonQueryNode.WrapMode
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmJsonQueryExpression
(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<String> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertToSqlAst
(SqmToSqlAstConverter walker) copy
(SqmCopyContext context) Sets theJpaJsonQueryNode.EmptyBehavior.EMPTY_ARRAY
for this json query expression.Sets theJpaJsonQueryNode.ErrorBehavior.EMPTY_ARRAY
for this json query expression.Sets theJpaJsonQueryNode.EmptyBehavior.EMPTY_OBJECT
for this json query expression.Sets theJpaJsonQueryNode.ErrorBehavior.EMPTY_OBJECT
for this json query expression.Sets theJpaJsonQueryNode.EmptyBehavior.ERROR
for this json query expression.Sets theJpaJsonQueryNode.ErrorBehavior.ERROR
for this json query expression.Get theJpaJsonQueryNode.EmptyBehavior
of this json query expression.Get theJpaJsonQueryNode.ErrorBehavior
of this json query expression.Get theJpaJsonQueryNode.WrapMode
of this json query expression.Sets theJpaJsonQueryNode.EmptyBehavior.NULL
for this json query expression.Sets theJpaJsonQueryNode.ErrorBehavior.NULL
for this json query expression.passing
(String parameterName, Expression<?> expression) Passes the givenExpression
as value for the parameter with the given name in the JSON path.Sets theJpaJsonQueryNode.EmptyBehavior.UNSPECIFIED
for this json query expression.Sets theJpaJsonQueryNode.ErrorBehavior.UNSPECIFIED
for this json query expression.Sets theJpaJsonQueryNode.WrapMode.UNSPECIFIED
for this json query expression.Sets theJpaJsonQueryNode.WrapMode.WITH_CONDITIONAL_WRAPPER
for this json query expression.Sets theJpaJsonQueryNode.WrapMode.WITHOUT_WRAPPER
for this json query expression.Sets theJpaJsonQueryNode.WrapMode.WITH_WRAPPER
for this json query 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
-
SqmJsonQueryExpression
public SqmJsonQueryExpression(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<String> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name)
-
-
Method Details
-
copy
- Specified by:
copy
in interfaceSqmExpression<String>
- Specified by:
copy
in interfaceSqmNode
- Specified by:
copy
in interfaceSqmSelectableNode<String>
- Specified by:
copy
in interfaceSqmTypedNode<String>
- Overrides:
copy
in classSelfRenderingSqmFunction<String>
-
getWrapMode
Description copied from interface:JpaJsonQueryNode
Get theJpaJsonQueryNode.WrapMode
of this json query expression.- Specified by:
getWrapMode
in interfaceJpaJsonQueryNode
- Returns:
- the wrap mode
-
getErrorBehavior
Description copied from interface:JpaJsonQueryNode
Get theJpaJsonQueryNode.ErrorBehavior
of this json query expression.- Specified by:
getErrorBehavior
in interfaceJpaJsonQueryNode
- Returns:
- the error behavior
-
getEmptyBehavior
Description copied from interface:JpaJsonQueryNode
Get theJpaJsonQueryNode.EmptyBehavior
of this json query expression.- Specified by:
getEmptyBehavior
in interfaceJpaJsonQueryNode
- Returns:
- the empty behavior
-
withoutWrapper
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.WrapMode.WITHOUT_WRAPPER
for this json query expression.- Specified by:
withoutWrapper
in interfaceJpaJsonQueryExpression
- Specified by:
withoutWrapper
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
withWrapper
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.WrapMode.WITH_WRAPPER
for this json query expression.- Specified by:
withWrapper
in interfaceJpaJsonQueryExpression
- Specified by:
withWrapper
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
withConditionalWrapper
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.WrapMode.WITH_CONDITIONAL_WRAPPER
for this json query expression.- Specified by:
withConditionalWrapper
in interfaceJpaJsonQueryExpression
- Specified by:
withConditionalWrapper
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
unspecifiedWrapper
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.WrapMode.UNSPECIFIED
for this json query expression.- Specified by:
unspecifiedWrapper
in interfaceJpaJsonQueryExpression
- Specified by:
unspecifiedWrapper
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
unspecifiedOnError
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.ErrorBehavior.UNSPECIFIED
for this json query expression.- Specified by:
unspecifiedOnError
in interfaceJpaJsonQueryExpression
- Specified by:
unspecifiedOnError
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
errorOnError
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.ErrorBehavior.ERROR
for this json query expression.- Specified by:
errorOnError
in interfaceJpaJsonQueryExpression
- Specified by:
errorOnError
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
nullOnError
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.ErrorBehavior.NULL
for this json query expression.- Specified by:
nullOnError
in interfaceJpaJsonQueryExpression
- Specified by:
nullOnError
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
emptyArrayOnError
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.ErrorBehavior.EMPTY_ARRAY
for this json query expression.- Specified by:
emptyArrayOnError
in interfaceJpaJsonQueryExpression
- Specified by:
emptyArrayOnError
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
emptyObjectOnError
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.ErrorBehavior.EMPTY_OBJECT
for this json query expression.- Specified by:
emptyObjectOnError
in interfaceJpaJsonQueryExpression
- Specified by:
emptyObjectOnError
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
unspecifiedOnEmpty
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.EmptyBehavior.UNSPECIFIED
for this json query expression.- Specified by:
unspecifiedOnEmpty
in interfaceJpaJsonQueryExpression
- Specified by:
unspecifiedOnEmpty
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
errorOnEmpty
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.EmptyBehavior.ERROR
for this json query expression.- Specified by:
errorOnEmpty
in interfaceJpaJsonQueryExpression
- Specified by:
errorOnEmpty
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
nullOnEmpty
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.EmptyBehavior.NULL
for this json query expression.- Specified by:
nullOnEmpty
in interfaceJpaJsonQueryExpression
- Specified by:
nullOnEmpty
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
emptyArrayOnEmpty
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.EmptyBehavior.EMPTY_ARRAY
for this json query expression.- Specified by:
emptyArrayOnEmpty
in interfaceJpaJsonQueryExpression
- Specified by:
emptyArrayOnEmpty
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
emptyObjectOnEmpty
Description copied from interface:JpaJsonQueryNode
Sets theJpaJsonQueryNode.EmptyBehavior.EMPTY_OBJECT
for this json query expression.- Specified by:
emptyObjectOnEmpty
in interfaceJpaJsonQueryExpression
- Specified by:
emptyObjectOnEmpty
in interfaceJpaJsonQueryNode
- Returns:
this
for method chaining
-
passing
Description copied from interface:JpaJsonQueryExpression
Passes the givenExpression
as value for the parameter with the given name in the JSON path.- Specified by:
passing
in interfaceJpaJsonQueryExpression
- Returns:
this
for method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAst
in classSelfRenderingSqmFunction<String>
-
appendHqlString
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
- Overrides:
appendHqlString
in classSqmFunction<String>
-