Interface SqmParameter<T>
- All Superinterfaces:
Comparable<SqmParameter<T>>,Expression<T>,JpaCriteriaNode,JpaExpression<T>,JpaParameterExpression<T>,JpaSelection<T>,JpaTupleElement<T>,Parameter<T>,ParameterExpression<T>,Selection<T>,Serializable,SqmExpressibleAccessor<T>,SqmExpression<T>,SqmNode,SqmSelectableNode<T>,SqmTypedNode<T>,SqmVisitableNode,TupleElement<T>
- All Known Implementing Classes:
AbstractSqmParameter,JpaCriteriaParameter,SqmJpaCriteriaParameterWrapper,SqmNamedParameter,SqmPositionalParameter,ValueBindJpaCriteriaParameter
public interface SqmParameter<T>
extends SqmExpression<T>, JpaParameterExpression<T>, Comparable<SqmParameter<T>>
Models a parameter expression declared in the query.
- Implementation Note:
- Each usage of a given named/positional query parameter
will result in a unique
SqmParameterinstance, each will simply use to the same binding. This is important to distinguish usage of the same parameter in different clauses which effects the rendering and value binding.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCan a collection/array of values be bound to this parameter?default intcompareTo(SqmParameter<T> parameter) copy()Make a copycopy(SqmCopyContext context) Based on the context it is declared, what is the anticipated type for bind values?getName()If this represents a named parameter, return that parameter name; otherwise returnnull.If this represents a positional parameter, return that parameter position; otherwise returnnull.Methods 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.Parameter
getParameterTypeMethods inherited from interface jakarta.persistence.criteria.Selection
isCompoundSelectionMethods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
applyInferableType, as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, cast, castAs, equalTo, equalTo, getNodeType, in, in, in, in, isNotNull, isNull, notEqualTo, notEqualTo, visitSubSelectableNodesMethods inherited from interface org.hibernate.query.sqm.tree.SqmNode
asLoggableText, nodeBuilderMethods 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
accept, appendHqlString, toHqlStringMethods inherited from interface jakarta.persistence.TupleElement
getAlias
-
Method Details
-
getName
String getName()If this represents a named parameter, return that parameter name; otherwise returnnull. -
getPosition
Integer getPosition()If this represents a positional parameter, return that parameter position; otherwise returnnull.- Specified by:
getPositionin interfaceParameter<T>- Returns:
- The parameter position
-
allowMultiValuedBinding
boolean allowMultiValuedBinding()Can a collection/array of values be bound to this parameter?This is allowed in very limited contexts within the query:
- as the value of an IN predicate if the only value is a single param
- (in non-strict JPA mode) as the final vararg to a function
- Returns:
trueif binding collection/array of values is allowed for this parameter;falseotherwise.
-
getAnticipatedType
BindableType<T> getAnticipatedType()Based on the context it is declared, what is the anticipated type for bind values?NOTE: If
allowMultiValuedBinding()is true, this will indicate the Type of the individual values.- Returns:
- The anticipated Type.
-
copy
SqmParameter<T> copy()Make a copy -
copy
- Specified by:
copyin interfaceSqmExpression<T>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<T>- Specified by:
copyin interfaceSqmTypedNode<T>
-
compareTo
- Specified by:
compareToin interfaceComparable<T>- Implementation Specification:
- Defined as default since this is an SPI to support any previous extensions
-