Class SqmJsonValueExpression<T>
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<T>
org.hibernate.query.sqm.tree.expression.SqmJsonValueExpression<T>
- All Implemented Interfaces:
Expression<T>
,Selection<T>
,TupleElement<T>
,Serializable
,JpaCriteriaNode
,JpaExpression<T>
,JpaFunction<T>
,JpaJsonValueExpression<T>
,JpaJsonValueNode<T>
,JpaSelection<T>
,JpaTupleElement<T>
,SemanticPathPart
,SqmExpression<T>
,SqmSelectableNode<T>
,SqmExpressibleAccessor<T>
,SqmNode
,SqmTypedNode<T>
,SqmVisitableNode
@Incubating
public class SqmJsonValueExpression<T>
extends AbstractSqmJsonPathExpression<T>
implements JpaJsonValueExpression<T>
Special expression for the json_value 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.JpaJsonValueNode
JpaJsonValueNode.EmptyBehavior, JpaJsonValueNode.ErrorBehavior
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionSqmJsonValueExpression
(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<T> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertToSqlAst
(SqmToSqlAstConverter walker) copy
(SqmCopyContext context) defaultOnEmpty
(Expression<?> expression) Sets theJpaJsonValueNode.EmptyBehavior.DEFAULT
for this json value expression.defaultOnError
(Expression<?> expression) Sets theJpaJsonValueNode.ErrorBehavior.DEFAULT
for this json value expression.Sets theJpaJsonValueNode.EmptyBehavior.ERROR
for this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.ERROR
for this json value expression.Get theJpaJsonValueNode.EmptyBehavior
of this json value expression.@Nullable JpaExpression<T>
Get theJpaExpression
that is returned when the JSON path does not resolve for a JSON document.Get theJpaJsonValueNode.ErrorBehavior
of this json value expression.@Nullable JpaExpression<T>
Get theJpaExpression
that is returned on a json processing error.Sets theJpaJsonValueNode.EmptyBehavior.NULL
for this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.NULL
for this json value expression.passing
(String parameterName, Expression<?> expression) Passes the givenExpression
as value for the parameter with the given name in the JSON path.Sets theJpaJsonValueNode.EmptyBehavior.UNSPECIFIED
for this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.UNSPECIFIED
for this json value 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
-
SqmJsonValueExpression
public SqmJsonValueExpression(SqmFunctionDescriptor descriptor, FunctionRenderer renderer, List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<T> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, FunctionReturnTypeResolver returnTypeResolver, NodeBuilder nodeBuilder, String name)
-
-
Method Details
-
copy
- Specified by:
copy
in interfaceSqmExpression<T>
- Specified by:
copy
in interfaceSqmNode
- Specified by:
copy
in interfaceSqmSelectableNode<T>
- Specified by:
copy
in interfaceSqmTypedNode<T>
- Overrides:
copy
in classSelfRenderingSqmFunction<T>
-
getErrorBehavior
Description copied from interface:JpaJsonValueNode
Get theJpaJsonValueNode.ErrorBehavior
of this json value expression.- Specified by:
getErrorBehavior
in interfaceJpaJsonValueNode<T>
- Returns:
- the error behavior
-
getEmptyBehavior
Description copied from interface:JpaJsonValueNode
Get theJpaJsonValueNode.EmptyBehavior
of this json value expression.- Specified by:
getEmptyBehavior
in interfaceJpaJsonValueNode<T>
- Returns:
- the empty behavior
-
getErrorDefault
Description copied from interface:JpaJsonValueNode
Get theJpaExpression
that is returned on a json processing error. Returnsnull
ifJpaJsonValueNode.getErrorBehavior()
is notJpaJsonValueNode.ErrorBehavior.DEFAULT
.- Specified by:
getErrorDefault
in interfaceJpaJsonValueNode<T>
- Returns:
- the value to return on a json processing error
-
getEmptyDefault
Description copied from interface:JpaJsonValueNode
Get theJpaExpression
that is returned when the JSON path does not resolve for a JSON document. Returnsnull
ifJpaJsonValueNode.getEmptyBehavior()
is notJpaJsonValueNode.EmptyBehavior.DEFAULT
.- Specified by:
getEmptyDefault
in interfaceJpaJsonValueNode<T>
- Returns:
- the value to return on a json processing error
-
unspecifiedOnError
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.ErrorBehavior.UNSPECIFIED
for this json value expression.- Specified by:
unspecifiedOnError
in interfaceJpaJsonValueExpression<T>
- Specified by:
unspecifiedOnError
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
errorOnError
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.ErrorBehavior.ERROR
for this json value expression.- Specified by:
errorOnError
in interfaceJpaJsonValueExpression<T>
- Specified by:
errorOnError
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
nullOnError
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.ErrorBehavior.NULL
for this json value expression.- Specified by:
nullOnError
in interfaceJpaJsonValueExpression<T>
- Specified by:
nullOnError
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
defaultOnError
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.ErrorBehavior.DEFAULT
for this json value expression.- Specified by:
defaultOnError
in interfaceJpaJsonValueExpression<T>
- Specified by:
defaultOnError
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
unspecifiedOnEmpty
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.EmptyBehavior.UNSPECIFIED
for this json value expression.- Specified by:
unspecifiedOnEmpty
in interfaceJpaJsonValueExpression<T>
- Specified by:
unspecifiedOnEmpty
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
errorOnEmpty
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.EmptyBehavior.ERROR
for this json value expression.- Specified by:
errorOnEmpty
in interfaceJpaJsonValueExpression<T>
- Specified by:
errorOnEmpty
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
nullOnEmpty
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.EmptyBehavior.NULL
for this json value expression.- Specified by:
nullOnEmpty
in interfaceJpaJsonValueExpression<T>
- Specified by:
nullOnEmpty
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
defaultOnEmpty
Description copied from interface:JpaJsonValueNode
Sets theJpaJsonValueNode.EmptyBehavior.DEFAULT
for this json value expression.- Specified by:
defaultOnEmpty
in interfaceJpaJsonValueExpression<T>
- Specified by:
defaultOnEmpty
in interfaceJpaJsonValueNode<T>
- Returns:
this
for method chaining
-
passing
Description copied from interface:JpaJsonValueExpression
Passes the givenExpression
as value for the parameter with the given name in the JSON path.- Specified by:
passing
in interfaceJpaJsonValueExpression<T>
- Returns:
this
for method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAst
in classSelfRenderingSqmFunction<T>
-
appendHqlString
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
- Overrides:
appendHqlString
in classSqmFunction<T>
-