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 TypeMethodDescriptionvoidappendHqlString(StringBuilder hql, SqmRenderContext context) convertToSqlAst(SqmToSqlAstConverter walker) copy(SqmCopyContext context) defaultOnEmpty(Expression<?> expression) Sets theJpaJsonValueNode.EmptyBehavior.DEFAULTfor this json value expression.defaultOnError(Expression<?> expression) Sets theJpaJsonValueNode.ErrorBehavior.DEFAULTfor this json value expression.Sets theJpaJsonValueNode.EmptyBehavior.ERRORfor this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.ERRORfor this json value expression.Get theJpaJsonValueNode.EmptyBehaviorof this json value expression.@Nullable JpaExpression<T> Get theJpaExpressionthat is returned when the JSON path does not resolve for a JSON document.Get theJpaJsonValueNode.ErrorBehaviorof this json value expression.@Nullable JpaExpression<T> Get theJpaExpressionthat is returned on a json processing error.Sets theJpaJsonValueNode.EmptyBehavior.NULLfor this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.NULLfor this json value expression.passing(String parameterName, Expression<?> expression) Passes the givenExpressionas value for the parameter with the given name in the JSON path.Sets theJpaJsonValueNode.EmptyBehavior.UNSPECIFIEDfor this json value expression.Sets theJpaJsonValueNode.ErrorBehavior.UNSPECIFIEDfor this json value expression.Methods inherited from class org.hibernate.query.sqm.tree.expression.AbstractSqmJsonPathExpression
addPassingExpression, appendPassingExpressionHqlString, copyPassingExpressions, createJsonPathPassingClause, getPassingExpressionsMethods inherited from class org.hibernate.query.sqm.function.SelfRenderingSqmFunction
determineResultType, getArgumentsValidator, getFunctionRenderer, getImpliedResultType, getMappingModelExpressible, getNodeType, getReturnTypeResolver, resolveResultType, resolveSqlAstArgumentsMethods inherited from class org.hibernate.query.sqm.tree.expression.SqmFunction
accept, equals, getArguments, getFunctionDescriptor, getFunctionName, hashCode, resolveIndexedAccess, resolvePathPartMethods 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, notEqualToMethods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaSelection
alias, getSelectionItems, isCompoundSelectionMethods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement
copyTo, getAlias, setAlias, setExpressibleTypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.query.criteria.JpaSelection
alias, getCompoundSelectionItems, getSelectionItemsMethods inherited from interface org.hibernate.query.criteria.JpaTupleElement
getJavaType, getJavaTypeDescriptor, getJavaTypeName, isEnumMethods inherited from interface jakarta.persistence.criteria.Selection
isCompoundSelectionMethods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
castAs, visitSubSelectableNodesMethods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableTextMethods inherited from interface org.hibernate.query.sqm.tree.select.SqmSelectableNode
getTupleLengthMethods inherited from interface org.hibernate.query.sqm.tree.SqmTypedNode
getExpressible, getNodeJavaTypeMethods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
toHqlStringMethods 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:
copyin interfaceSqmExpression<T>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<T>- Specified by:
copyin interfaceSqmTypedNode<T>- Overrides:
copyin classSelfRenderingSqmFunction<T>
-
getErrorBehavior
Description copied from interface:JpaJsonValueNodeGet theJpaJsonValueNode.ErrorBehaviorof this json value expression.- Specified by:
getErrorBehaviorin interfaceJpaJsonValueNode<T>- Returns:
- the error behavior
-
getEmptyBehavior
Description copied from interface:JpaJsonValueNodeGet theJpaJsonValueNode.EmptyBehaviorof this json value expression.- Specified by:
getEmptyBehaviorin interfaceJpaJsonValueNode<T>- Returns:
- the empty behavior
-
getErrorDefault
Description copied from interface:JpaJsonValueNodeGet theJpaExpressionthat is returned on a json processing error. ReturnsnullifJpaJsonValueNode.getErrorBehavior()is notJpaJsonValueNode.ErrorBehavior.DEFAULT.- Specified by:
getErrorDefaultin interfaceJpaJsonValueNode<T>- Returns:
- the value to return on a json processing error
-
getEmptyDefault
Description copied from interface:JpaJsonValueNodeGet theJpaExpressionthat is returned when the JSON path does not resolve for a JSON document. ReturnsnullifJpaJsonValueNode.getEmptyBehavior()is notJpaJsonValueNode.EmptyBehavior.DEFAULT.- Specified by:
getEmptyDefaultin interfaceJpaJsonValueNode<T>- Returns:
- the value to return on a json processing error
-
unspecifiedOnError
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.ErrorBehavior.UNSPECIFIEDfor this json value expression.- Specified by:
unspecifiedOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
unspecifiedOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
errorOnError
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.ErrorBehavior.ERRORfor this json value expression.- Specified by:
errorOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
errorOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
nullOnError
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.ErrorBehavior.NULLfor this json value expression.- Specified by:
nullOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
nullOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
defaultOnError
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.ErrorBehavior.DEFAULTfor this json value expression.- Specified by:
defaultOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
defaultOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
unspecifiedOnEmpty
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.EmptyBehavior.UNSPECIFIEDfor this json value expression.- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
errorOnEmpty
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.EmptyBehavior.ERRORfor this json value expression.- Specified by:
errorOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
errorOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
nullOnEmpty
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.EmptyBehavior.NULLfor this json value expression.- Specified by:
nullOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
nullOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
defaultOnEmpty
Description copied from interface:JpaJsonValueNodeSets theJpaJsonValueNode.EmptyBehavior.DEFAULTfor this json value expression.- Specified by:
defaultOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
defaultOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
passing
Description copied from interface:JpaJsonValueExpressionPasses the givenExpressionas value for the parameter with the given name in the JSON path.- Specified by:
passingin interfaceJpaJsonValueExpression<T>- Returns:
thisfor method chaining
-
convertToSqlAst
- Overrides:
convertToSqlAstin classSelfRenderingSqmFunction<T>
-
appendHqlString
- Specified by:
appendHqlStringin interfaceSqmVisitableNode- Overrides:
appendHqlStringin classSqmFunction<T>
-