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

public Class SqmJpaCriteriaParameterWrapper<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
Imports
java.util.function.Consumer, org.hibernate.query.BindableType, org.hibernate.query.sqm.NodeBuilder, .SemanticQueryWalker, org.hibernate.query.sqm.tree.SqmCopyContext, org.hibernate.query.sqm.tree.select.SqmSelectableNode, org.hibernate.sql.ast.tree.expression.JdbcParameter

Acts as the per-use wrapper for a JpaCriteriaParameter (jakarta.persistence.criteria.CriteriaBuilder#parameter). JpaCriteriaParameter is the "domain query parameter" (org.hibernate.query.QueryParameter while SqmJpaCriteriaParameterWrapper is the SqmParameter

Field Summary

Modifier and TypeField and Description
private final JpaCriteriaParameter<T>

Constructor Summary

AccessConstructor and Description
public
SqmJpaCriteriaParameterWrapper(BindableType<T> type, JpaCriteriaParameter<T> jpaCriteriaParameter, NodeBuilder criteriaBuilder)

Method Summary

Modifier and TypeMethod and Description
public <X> X
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 int
compareTo(SqmParameter<T>
the object to be compared.
anotherParameter
)

Overrides default org.hibernate.query.sqm.tree.expression.SqmParameter.compareTo.

Compares this object with the specified object for order.
public SqmJpaCriteriaParameterWrapper<T>
public SqmParameter<T>
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 JpaCriteriaParameter<T>
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 void
visitSubSelectableNodes(Consumer<SqmSelectableNode<?>> jpaSelectionConsumer)

Overrides default org.hibernate.query.sqm.tree.expression.SqmExpression.visitSubSelectableNodes.

Implements org.hibernate.query.sqm.tree.select.SqmSelectableNode.visitSubSelectableNodes.

Visit each of this selectable's direct sub-selectables - used to support JPA's Selection model (which is really a "selectable", just poorly named and poorly defined
Inherited from org.hibernate.query.sqm.tree.expression.AbstractSqmExpression:
aliasapplyInferableTypeasasBigDecimalasBigIntegerasDoubleasFloatasIntegerasLongasStringequalToequalTogetJavaTypeDescriptorinininininternalApplyInferableTypeisNotNullisNullnodeBuilder

Field Detail

jpaCriteriaParameterback to summary
private final JpaCriteriaParameter<T> jpaCriteriaParameter

Constructor Detail

SqmJpaCriteriaParameterWrapperback to summary
public SqmJpaCriteriaParameterWrapper(BindableType<T> type, JpaCriteriaParameter<T> jpaCriteriaParameter, NodeBuilder criteriaBuilder)

Method Detail

acceptback to summary
public <X> X accept(SemanticQueryWalker<X> walker)

Implements org.hibernate.query.sqm.tree.SqmVisitableNode.accept.

Unsupported. Visitation for a criteria parameter should be handled as part of SemanticQueryWalker#visitJpaCriteriaParameter. This wrapper is intended just for representing unique SqmParameter references for each JpaCriteriaParameter occurrence in the SQM true as part of the org.hibernate.query.QueryParameter to SqmParameter to JdbcParameter transformation. Each occurrence requires a unique SqmParameter to make sure we ultimately get the complete set of JdbcParameter references

Annotations
@Override
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
appendHqlStringback to summary
public void appendHqlString(StringBuilder sb)

Implements org.hibernate.query.sqm.tree.SqmVisitableNode.appendHqlString.

Annotations
@Override
compareToback to summary
public int compareTo(SqmParameter<T> anotherParameter)

Overrides default org.hibernate.query.sqm.tree.expression.SqmParameter.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
anotherParameter:SqmParameter<T>

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
copyback to summary
public SqmJpaCriteriaParameterWrapper<T> copy(SqmCopyContext context)

Implements org.hibernate.query.sqm.tree.expression.SqmParameter.copy, org.hibernate.query.sqm.tree.expression.SqmExpression.copy, org.hibernate.query.sqm.tree.select.SqmSelectableNode.copy, org.hibernate.query.sqm.tree.SqmNode.copy.

Annotations
@Override
copyback to summary
public SqmParameter<T> copy()

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

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

Make a copy

Annotations
@Override
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
getJpaCriteriaParameterback to summary
public JpaCriteriaParameter<T> getJpaCriteriaParameter()
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
visitSubSelectableNodesback to summary
public void visitSubSelectableNodes(Consumer<SqmSelectableNode<?>> jpaSelectionConsumer)

Overrides default org.hibernate.query.sqm.tree.expression.SqmExpression.visitSubSelectableNodes.

Implements org.hibernate.query.sqm.tree.select.SqmSelectableNode.visitSubSelectableNodes.

Doc from org.hibernate.query.sqm.tree.select.SqmSelectableNode.visitSubSelectableNodes.

Visit each of this selectable's direct sub-selectables - used to support JPA's Selection model (which is really a "selectable", just poorly named and poorly defined

Annotations
@Override