Class SqmJsonValueExpression<T>
java.lang.Object
org.hibernate.query.sqm.tree.spi.AbstractSqmNode
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaTupleElement<T>
org.hibernate.query.sqm.tree.spi.jpa.AbstractJpaSelection<T>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmExpression<T>
org.hibernate.query.sqm.tree.spi.expression.SqmFunction<T>
org.hibernate.query.sqm.function.SelfRenderingSqmFunction<T>
org.hibernate.query.sqm.tree.spi.expression.AbstractSqmJsonPathExpression<T>
org.hibernate.query.sqm.tree.spi.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(since="6.2")
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, ReturnableType<T> impliedResultType, 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) Use the JSON empty behavior that returns the given default value.defaultOnError(Expression<?> expression) Use the JSON error behavior that returns the given default value.booleanUse the JSON empty behavior that raises an error.Use the JSON error behavior that raises an error.Get theJpaJsonValueNode.EmptyBehaviorof this json value expression.Get theJpaExpressionthat is returned when the JSON path does not resolve for a JSON document.Get theJpaJsonValueNode.ErrorBehaviorof this json value expression.Get theJpaExpressionthat is returned on a json processing error.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.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
-
SqmJsonValueExpression
public SqmJsonValueExpression(@Nonnull SqmFunctionDescriptor descriptor, @Nonnull FunctionRenderer renderer, @Nonnull List<? extends SqmTypedNode<?>> arguments, @Nullable ReturnableType<T> impliedResultType, @Nullable ArgumentsValidator argumentsValidator, @Nonnull FunctionReturnTypeResolver returnTypeResolver, @Nonnull NodeBuilder nodeBuilder, @Nonnull 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:JpaJsonValueExpressionUse the unspecified JSON error behavior.- Specified by:
unspecifiedOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
unspecifiedOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
errorOnError
Description copied from interface:JpaJsonValueExpressionUse the JSON error behavior that raises an error.- Specified by:
errorOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
errorOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
nullOnError
Description copied from interface:JpaJsonValueExpressionUse the JSON error behavior that returns null.- Specified by:
nullOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
nullOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
defaultOnError
Description copied from interface:JpaJsonValueExpressionUse the JSON error behavior that returns the given default value.- Specified by:
defaultOnErrorin interfaceJpaJsonValueExpression<T>- Specified by:
defaultOnErrorin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
unspecifiedOnEmpty
Description copied from interface:JpaJsonValueExpressionUse the unspecified JSON empty behavior.- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
unspecifiedOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
errorOnEmpty
Description copied from interface:JpaJsonValueExpressionUse the JSON empty behavior that raises an error.- Specified by:
errorOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
errorOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
nullOnEmpty
Description copied from interface:JpaJsonValueExpressionUse the JSON empty behavior that returns null.- Specified by:
nullOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
nullOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
defaultOnEmpty
Description copied from interface:JpaJsonValueExpressionUse the JSON empty behavior that returns the given default value.- Specified by:
defaultOnEmptyin interfaceJpaJsonValueExpression<T>- Specified by:
defaultOnEmptyin interfaceJpaJsonValueNode<T>- Returns:
thisfor method chaining
-
passing
@Nonnull public SqmJsonValueExpression<T> passing(@Nonnull String parameterName, @Nonnull Expression<?> expression) 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>
-