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

public Interface SqmExpression<T>

extends SqmSelectableNode<T>, JpaExpression<T>
Known Direct Subinterfaces
org.hibernate.query.sqm.tree.expression.SqmParameter, org.hibernate.query.sqm.tree.expression.SqmWindowFunction, org.hibernate.query.sqm.tree.predicate.SqmPredicate, org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.sqm.tree.expression.SqmAggregateFunction
Known Direct Implementers
org.hibernate.query.sqm.tree.expression.SqmFieldLiteral, org.hibernate.query.sqm.tree.select.SqmSubQuery, org.hibernate.query.hql.internal.FullyQualifiedReflectivePathTerminal, org.hibernate.query.sqm.tree.expression.AbstractSqmExpression
Type Parameters
<T>
The Java type of the expression
Imports
java.math.BigDecimal, .BigInteger, java.util.Collection, java.util.function.Consumer, jakarta.persistence.criteria.Expression, org.hibernate.Internal, org.hibernate.query.ReturnableType, org.hibernate.metamodel.model.domain.DomainType, org.hibernate.query.criteria.JpaExpression, org.hibernate.query.spi.QueryEngine, org.hibernate.query.sqm.SqmExpressible, org.hibernate.query.sqm.tree.SqmCopyContext, org.hibernate.query.sqm.tree.predicate.SqmPredicate, org.hibernate.query.sqm.tree.select.SqmSelectableNode

The base contract for any kind of expression node in the SQM tree. An expression might be a reference to an attribute, a literal, a function, etc.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public void
applyInferableType(SqmExpressible<?> type)

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

public <X> SqmExpression<X>
as(Class<X>
intended type of the expression
type
)

Redeclares org.hibernate.query.criteria.JpaExpression.as.

Perform a typecast upon the expression, returning a new expression object.
public SqmExpression<BigDecimal>
public SqmExpression<BigInteger>
public SqmExpression<Double>
public SqmExpression<Float>
public SqmExpression<Integer>
public SqmExpression<Long>
public SqmExpression<String>
public default <X> SqmExpression<X>
castAs(DomainType<X> type)

public SqmExpression<T>
public SqmPredicate
public SqmPredicate
public SqmExpressible<T>
public SqmPredicate
in(Object...
values to be tested against
values
)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Create a predicate to test whether the expression is a member of the argument list.
public SqmPredicate
in(Expression<?>...
expressions to be tested against
values
)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Create a predicate to test whether the expression is a member of the argument list.
public SqmPredicate
in(Collection<?>
collection of values to be tested against
values
)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Create a predicate to test whether the expression is a member of the collection.
public SqmPredicate
in(Expression<Collection<?>>
expression corresponding to collection to be tested against
values
)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Create a predicate to test whether the expression is a member of the collection.
public SqmPredicate
isNotNull()

Redeclares org.hibernate.query.criteria.JpaExpression.isNotNull.

Create a predicate to test whether the expression is not null.
public SqmPredicate
isNull()

Redeclares org.hibernate.query.criteria.JpaExpression.isNull.

Create a predicate to test whether the expression is null.
public default void
visitSubSelectableNodes(Consumer<SqmSelectableNode<?>> jpaSelectionConsumer)

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.select.SqmSelectableNode:
getTupleLength

Method Detail

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

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

API Note

The SqmExpressible type parameter is dropped here because the inference could technically cause a change in Java type (i.e. an implicit cast)

Annotations
@Internal
asback to summary
public <X> SqmExpression<X> as(Class<X> type)

Redeclares org.hibernate.query.criteria.JpaExpression.as.

Doc from jakarta.persistence.criteria.Expression.as.

Perform a typecast upon the expression, returning a new expression object. This method does not cause type conversion: the runtime type is not changed.

Warning

may result in a runtime failure.

Parameters
type:Class<X>

intended type of the expression

Returns:SqmExpression<X>

new expression of the given type

Annotations
@Override
asBigDecimalback to summary
public SqmExpression<BigDecimal> asBigDecimal()

Redeclares org.hibernate.query.criteria.JpaExpression.asBigDecimal.

Annotations
@Override
asBigIntegerback to summary
public SqmExpression<BigInteger> asBigInteger()

Redeclares org.hibernate.query.criteria.JpaExpression.asBigInteger.

Annotations
@Override
asDoubleback to summary
public SqmExpression<Double> asDouble()

Redeclares org.hibernate.query.criteria.JpaExpression.asDouble.

Annotations
@Override
asFloatback to summary
public SqmExpression<Float> asFloat()

Redeclares org.hibernate.query.criteria.JpaExpression.asFloat.

Annotations
@Override
asIntegerback to summary
public SqmExpression<Integer> asInteger()

Redeclares org.hibernate.query.criteria.JpaExpression.asInteger.

Annotations
@Override
asLongback to summary
public SqmExpression<Long> asLong()

Redeclares org.hibernate.query.criteria.JpaExpression.asLong.

Annotations
@Override
asStringback to summary
public SqmExpression<String> asString()

Redeclares org.hibernate.query.criteria.JpaExpression.asString.

Annotations
@Override
castAsback to summary
public default <X> SqmExpression<X> castAs(DomainType<X> type)
copyback to summary
public SqmExpression<T> copy(SqmCopyContext context)

Redeclares org.hibernate.query.sqm.tree.select.SqmSelectableNode.copy.

Annotations
@Override
equalToback to summary
public SqmPredicate equalTo(Expression<T> that)

Redeclares org.hibernate.query.criteria.JpaExpression.equalTo, org.hibernate.query.criteria.JpaExpression.equalTo.

Annotations
@Override
equalToback to summary
public SqmPredicate equalTo(T that)

Redeclares org.hibernate.query.criteria.JpaExpression.equalTo.

Annotations
@Override
getNodeTypeback to summary
public SqmExpressible<T> getNodeType()

Redeclares org.hibernate.query.sqm.tree.SqmTypedNode.getNodeType.

The expression's type.

Can change as a result of calls to applyInferableType

Annotations
@Override
inback to summary
public SqmPredicate in(Object... values)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Doc from jakarta.persistence.criteria.Expression.in.

Create a predicate to test whether the expression is a member of the argument list.

Parameters
values:Object[]

values to be tested against

Returns:SqmPredicate

predicate testing for membership

Annotations
@Override
inback to summary
public SqmPredicate in(Expression<?>... values)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Doc from jakarta.persistence.criteria.Expression.in.

Create a predicate to test whether the expression is a member of the argument list.

Parameters
values:Expression<?>[]

expressions to be tested against

Returns:SqmPredicate

predicate testing for membership

Annotations
@Override
inback to summary
public SqmPredicate in(Collection<?> values)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Doc from jakarta.persistence.criteria.Expression.in.

Create a predicate to test whether the expression is a member of the collection.

Parameters
values:Collection<?>

collection of values to be tested against

Returns:SqmPredicate

predicate testing for membership

Annotations
@Override
inback to summary
public SqmPredicate in(Expression<Collection<?>> values)

Redeclares org.hibernate.query.criteria.JpaExpression.in.

Doc from jakarta.persistence.criteria.Expression.in.

Create a predicate to test whether the expression is a member of the collection.

Parameters
values:Expression<Collection<?>>

expression corresponding to collection to be tested against

Returns:SqmPredicate

predicate testing for membership

Annotations
@Override
isNotNullback to summary
public SqmPredicate isNotNull()

Redeclares org.hibernate.query.criteria.JpaExpression.isNotNull.

Doc from jakarta.persistence.criteria.Expression.isNotNull.

Create a predicate to test whether the expression is not null.

Returns:SqmPredicate

predicate testing whether the expression is not null

Annotations
@Override
isNullback to summary
public SqmPredicate isNull()

Redeclares org.hibernate.query.criteria.JpaExpression.isNull.

Doc from jakarta.persistence.criteria.Expression.isNull.

Create a predicate to test whether the expression is null.

Returns:SqmPredicate

predicate testing whether the expression is null

Annotations
@Override
visitSubSelectableNodesback to summary
public default void visitSubSelectableNodes(Consumer<SqmSelectableNode<?>> jpaSelectionConsumer)

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