Top Description Fields Constructors Methods
org.hibernate.query.sqm.tree.expression

public abstract Class AbstractSqmParameter<T>

extends AbstractSqmExpression<T>
implements SqmParameter<T>
Class Inheritance
All Implemented Interfaces
org.hibernate.query.sqm.tree.expression.SqmParameter, java.lang.Comparable, org.hibernate.query.criteria.JpaParameterExpression, org.hibernate.query.criteria.JpaCriteriaNode, java.io.Serializable, jakarta.persistence.criteria.ParameterExpression, jakarta.persistence.criteria.Expression, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement, jakarta.persistence.Parameter, org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.criteria.JpaExpression, org.hibernate.query.criteria.JpaSelection, org.hibernate.query.criteria.JpaTupleElement, org.hibernate.query.sqm.tree.select.SqmSelectableNode, org.hibernate.query.sqm.tree.SqmTypedNode, org.hibernate.query.sqm.tree.SqmVisitableNode, org.hibernate.query.sqm.tree.SqmNode, org.hibernate.query.sqm.tree.SqmExpressibleAccessor
Known Direct Subclasses
org.hibernate.query.sqm.tree.expression.SqmNamedParameter, org.hibernate.query.sqm.tree.expression.SqmPositionalParameter
Imports
org.hibernate.metamodel.model.domain.PluralPersistentAttribute, org.hibernate.query.BindableType, org.hibernate.query.sqm.NodeBuilder, .SqmExpressible

Common support for SqmParameter impls
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public
AbstractSqmParameter(boolean canBeMultiValued, SqmExpressible<T> inherentType, NodeBuilder nodeBuilder)

Method Summary

Modifier and TypeMethod and Description
public boolean
allowMultiValuedBinding()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.allowMultiValuedBinding.

Can a collection/array of values be bound to this parameter?
public void
public void
public BindableType<T>
getAnticipatedType()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getAnticipatedType.

Based on the context it is declared, what is the anticipated type for bind values?
public String
getName()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getName.

If this represents a named parameter, return that parameter name; otherwise return null.
public Class<T>
getParameterType()

Implements jakarta.persistence.Parameter.getParameterType.

Return the Java type of the parameter.
public Integer
getPosition()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getPosition.

If this represents a positional parameter, return that parameter position; otherwise return null.
public Integer
Inherited from org.hibernate.query.sqm.tree.expression.AbstractSqmExpression:
aliasasasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringequalToequalTogetJavaTypeDescriptorinininininternalApplyInferableTypeisNotNullisNullnodeBuilder

Field Detail

canBeMultiValuedback to summary
private boolean canBeMultiValued

Constructor Detail

AbstractSqmParameterback to summary
public AbstractSqmParameter(boolean canBeMultiValued, SqmExpressible<T> inherentType, NodeBuilder nodeBuilder)

Method Detail

allowMultiValuedBindingback to summary
public boolean allowMultiValuedBinding()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.allowMultiValuedBinding.

Doc from org.hibernate.query.sqm.tree.expression.SqmParameter.allowMultiValuedBinding.

Can a collection/array of values be bound to this parameter?

This is allowed in very limited contexts within the query:

  1. as the value of an IN predicate if the only value is a single param
  2. (in non-strict JPA mode) as the final vararg to a function
Returns:boolean

true if binding collection/array of values is allowed for this parameter; false otherwise.

Annotations
@Override
applyInferableTypeback to summary
public void applyInferableType(SqmExpressible<?> type)

Overrides org.hibernate.query.sqm.tree.expression.AbstractSqmExpression.applyInferableType.

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Doc from org.hibernate.query.sqm.tree.expression.SqmExpression.applyInferableType.

Used to apply type information based on the expression's usage within the query.

Annotations
@Override
disallowMultiValuedBindingback to summary
public void disallowMultiValuedBinding()
getAnticipatedTypeback to summary
public BindableType<T> getAnticipatedType()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getAnticipatedType.

Doc from org.hibernate.query.sqm.tree.expression.SqmParameter.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:BindableType<T>

The anticipated Type.

Annotations
@Override
getNameback to summary
public String getName()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getName.

Doc from org.hibernate.query.sqm.tree.expression.SqmParameter.getName.

If this represents a named parameter, return that parameter name; otherwise return null.

Returns:String

The parameter name, or null if not a named parameter

Annotations
@Override
getParameterTypeback to summary
public Class<T> getParameterType()

Implements jakarta.persistence.Parameter.getParameterType.

Doc from jakarta.persistence.Parameter.getParameterType.

Return the Java type of the parameter. Values bound to the parameter must be assignable to this type. This method is required to be supported for criteria queries only. Applications that use this method for Jakarta Persistence query language queries and native queries will not be portable.

Returns:Class<T>

the Java type of the parameter

Annotations
@Override
getPositionback to summary
public Integer getPosition()

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.getPosition.

Doc from org.hibernate.query.sqm.tree.expression.SqmParameter.getPosition.

If this represents a positional parameter, return that parameter position; otherwise return null.

Returns:Integer

The parameter position

Annotations
@Override
getTupleLengthback to summary
public Integer getTupleLength()

Overrides default org.hibernate.query.sqm.tree.select.SqmSelectableNode.getTupleLength.

Annotations
@Override