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>, SqmCacheable, 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 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) intconvertToSqlAst(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.booleanSets 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.inthashCode()booleanisCompatible(Object other) 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 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, equalTo, equalTo, getJavaTypeDescriptor, in, in, in, in, internalApplyInferableType, isNotNull, isNull, nodeBuilder, notEqualTo, notEqualToMethods 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 JpaSelection
alias, getCompoundSelectionItems, getSelectionItemsMethods inherited from interface JpaTupleElement
getJavaType, getJavaTypeDescriptor, 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
-
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>
-
equals
- Overrides:
equalsin classAbstractSqmJsonPathExpression<T>
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractSqmJsonPathExpression<T>
-
isCompatible
- Specified by:
isCompatiblein interfaceSqmCacheable- Overrides:
isCompatiblein classAbstractSqmJsonPathExpression<T>
-
cacheHashCode
public int cacheHashCode()- Specified by:
cacheHashCodein interfaceSqmCacheable- Overrides:
cacheHashCodein classAbstractSqmJsonPathExpression<T>
-