Class AbstractSqmParameter<T>

All Implemented Interfaces:
Expression<T>, ParameterExpression<T>, Selection<T>, Parameter<T>, TupleElement<T>, Serializable, Comparable<SqmParameter<T>>, JpaCriteriaNode, JpaExpression<T>, JpaParameterExpression<T>, JpaSelection<T>, JpaTupleElement<T>, SqmExpression<T>, SqmParameter<T>, SqmSelectableNode<T>, SqmExpressibleAccessor<T>, SqmNode, SqmTypedNode<T>, SqmVisitableNode
Direct Known Subclasses:
SqmNamedParameter, SqmPositionalParameter

public abstract class AbstractSqmParameter<T> extends AbstractSqmExpression<T> implements SqmParameter<T>
Common support for SqmParameter impls
See Also:
  • Constructor Details

    • AbstractSqmParameter

      public AbstractSqmParameter(boolean canBeMultiValued, SqmExpressible<T> inherentType, NodeBuilder nodeBuilder)
  • Method Details

    • applyInferableType

      public void applyInferableType(@Nullable SqmExpressible<?> type)
      Description copied from interface: SqmExpression
      Used to apply type information based on the expression's usage within the query.
      Specified by:
      applyInferableType in interface SqmExpression<T>
      Overrides:
      applyInferableType in class AbstractSqmExpression<T>
    • getName

      public String getName()
      Description copied from interface: SqmParameter
      If this represents a named parameter, return that parameter name; otherwise return null.
      Specified by:
      getName in interface Parameter<T>
      Specified by:
      getName in interface SqmParameter<T>
      Returns:
      The parameter name, or null if not a named parameter
    • getPosition

      public Integer getPosition()
      Description copied from interface: SqmParameter
      If this represents a positional parameter, return that parameter position; otherwise return null.
      Specified by:
      getPosition in interface Parameter<T>
      Specified by:
      getPosition in interface SqmParameter<T>
      Returns:
      The parameter position
    • allowMultiValuedBinding

      public boolean allowMultiValuedBinding()
      Description copied from interface: SqmParameter
      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
      Specified by:
      allowMultiValuedBinding in interface SqmParameter<T>
      Returns:
      true if binding collection/array of values is allowed for this parameter; false otherwise.
    • disallowMultiValuedBinding

      public void disallowMultiValuedBinding()
    • getAnticipatedType

      public BindableType<T> getAnticipatedType()
      Description copied from interface: SqmParameter
      Based on the context it is declared, what is the anticipated type for bind values?

      NOTE: If SqmParameter.allowMultiValuedBinding() is true, this will indicate the Type of the individual values.

      Specified by:
      getAnticipatedType in interface SqmParameter<T>
      Returns:
      The anticipated Type.
    • getParameterType

      public Class<T> getParameterType()
      Specified by:
      getParameterType in interface Parameter<T>
    • getTupleLength

      public Integer getTupleLength()
      Specified by:
      getTupleLength in interface SqmSelectableNode<T>