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

public Class SqmFieldLiteral<T>

extends Object
implements SqmExpression<T>, SqmExpressible<T>, SqmSelectableNode<T>, SemanticPathPart
Class Inheritance
All Implemented Interfaces
org.hibernate.query.hql.spi.SemanticPathPart, 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.criteria.JpaCriteriaNode, java.io.Serializable, org.hibernate.query.sqm.tree.SqmExpressibleAccessor, org.hibernate.query.criteria.JpaSelection, jakarta.persistence.criteria.Selection, jakarta.persistence.TupleElement, org.hibernate.query.criteria.JpaTupleElement, org.hibernate.query.sqm.SqmExpressible, org.hibernate.query.BindableType, org.hibernate.query.sqm.tree.expression.SqmExpression, org.hibernate.query.criteria.JpaExpression, jakarta.persistence.criteria.Expression
Imports
java.lang.reflect.Field, java.math.BigDecimal, .BigInteger, java.util.Collection, .List, .Locale, org.hibernate.QueryException, org.hibernate.metamodel.model.domain.DomainType, org.hibernate.query.criteria.JpaSelection, org.hibernate.query.hql.spi.SemanticPathPart, .SqmCreationState, org.hibernate.query.sqm.NodeBuilder, .SemanticQueryWalker, .SqmExpressible, .UnknownPathException, org.hibernate.query.sqm.tree.SqmCopyContext, org.hibernate.query.sqm.tree.domain.SqmPath, org.hibernate.query.sqm.tree.predicate.SqmPredicate, org.hibernate.query.sqm.tree.select.SqmSelectableNode, org.hibernate.type.descriptor.java.JavaType, jakarta.persistence.criteria.Expression

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private SqmExpressible<T>
private final JavaType<T>
private final String
private final NodeBuilder
private final T

Constructor Summary

AccessConstructor and Description
public
SqmFieldLiteral(Field field, JavaType<T> fieldJavaType, NodeBuilder nodeBuilder)

public
SqmFieldLiteral(T value, JavaType<T> fieldJavaType, String fieldName, NodeBuilder nodeBuilder)

Method Summary

Modifier and TypeMethod and Description
public <X> X
accept(SemanticQueryWalker<X> walker)

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

Accept the walker per visitation
public JpaSelection<T>
public void
public void
applyInferableType(SqmExpressible<?> type)

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

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
)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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 SqmFieldLiteral<T>
public SqmPredicate
public SqmPredicate
private static <T> T
public String
getAlias()

Implements jakarta.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.
public Class<T>
public JavaType<T>
getExpressibleJavaType()

Implements org.hibernate.query.sqm.SqmExpressible.getExpressibleJavaType.

The Java type descriptor for this expressible
public String
public JavaType<T>
public NodeBuilder
public SqmExpressible<T>
public List<? extends JpaSelection<?>>
public DomainType<T>
public T
public SqmPredicate
in(Object...
values to be tested against
values
)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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
)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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
)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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
)

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

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

Implements jakarta.persistence.criteria.Selection.isCompoundSelection.

Whether the selection item is a compound selection.
public SqmPredicate
isNotNull()

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

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

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

Create a predicate to test whether the expression is null.
public NodeBuilder
public SqmPath<?>
public SemanticPathPart
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

expressibleback to summary
private SqmExpressible<T> expressible
fieldJavaTypeback to summary
private final JavaType<T> fieldJavaType
fieldNameback to summary
private final String fieldName
nodeBuilderback to summary
private final NodeBuilder nodeBuilder
valueback to summary
private final T value

Constructor Detail

SqmFieldLiteralback to summary
public SqmFieldLiteral(Field field, JavaType<T> fieldJavaType, NodeBuilder nodeBuilder)
SqmFieldLiteralback to summary
public SqmFieldLiteral(T value, JavaType<T> fieldJavaType, String fieldName, NodeBuilder nodeBuilder)

Method Detail

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

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

Doc from org.hibernate.query.sqm.tree.SqmVisitableNode.accept.

Accept the walker per visitation

Annotations
@Override
aliasback to summary
public JpaSelection<T> alias(String name)

Implements org.hibernate.query.criteria.JpaSelection.alias, jakarta.persistence.criteria.Selection.alias.

Doc from jakarta.persistence.criteria.Selection.alias.

Assigns an alias to the selection item. Once assigned, an alias cannot be changed or reassigned. Returns the same selection item.

Parameters
name:String

alias

Returns:JpaSelection<T>

selection item

Annotations
@Override
appendHqlStringback to summary
public void appendHqlString(StringBuilder sb)

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

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

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
asback to summary
public <X> SqmExpression<X> as(Class<X> type)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.equalTo, org.hibernate.query.sqm.tree.expression.SqmExpression.equalTo.

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

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

Annotations
@Override
extractValueback to summary
private static <T> T extractValue(Field field)
getAliasback to summary
public String getAlias()

Implements jakarta.persistence.TupleElement.getAlias.

Doc from jakarta.persistence.TupleElement.getAlias.

Return the alias assigned to the tuple element or null, if no alias has been assigned.

Returns:String

alias

Annotations
@Override
getBindableJavaTypeback to summary
public Class<T> getBindableJavaType()

Implements org.hibernate.query.BindableType.getBindableJavaType.

Doc from org.hibernate.query.BindableType.getBindableJavaType.

The expected Java type

Annotations
@Override
getExpressibleJavaTypeback to summary
public JavaType<T> getExpressibleJavaType()

Implements org.hibernate.query.sqm.SqmExpressible.getExpressibleJavaType.

Doc from org.hibernate.query.sqm.SqmExpressible.getExpressibleJavaType.

The Java type descriptor for this expressible

Annotations
@Override
getFieldNameback to summary
public String getFieldName()
getJavaTypeDescriptorback to summary
public JavaType<T> getJavaTypeDescriptor()

Implements org.hibernate.query.criteria.JpaTupleElement.getJavaTypeDescriptor.

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

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.getNodeType, org.hibernate.query.sqm.tree.SqmTypedNode.getNodeType.

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

The expression's type.

Can change as a result of calls to applyInferableType

Annotations
@Override
getSelectionItemsback to summary
public List<? extends JpaSelection<?>> getSelectionItems()

Implements org.hibernate.query.criteria.JpaSelection.getSelectionItems.

Annotations
@Override
getSqmTypeback to summary
public DomainType<T> getSqmType()

Implements org.hibernate.query.sqm.SqmExpressible.getSqmType.

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

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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)

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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
isCompoundSelectionback to summary
public boolean isCompoundSelection()

Implements jakarta.persistence.criteria.Selection.isCompoundSelection.

Doc from jakarta.persistence.criteria.Selection.isCompoundSelection.

Whether the selection item is a compound selection.

Returns:boolean

boolean indicating whether the selection is a compound selection

Annotations
@Override
isNotNullback to summary
public SqmPredicate isNotNull()

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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()

Implements org.hibernate.query.sqm.tree.expression.SqmExpression.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
nodeBuilderback to summary
public NodeBuilder nodeBuilder()

Implements org.hibernate.query.sqm.tree.SqmNode.nodeBuilder.

Annotations
@Override
resolveIndexedAccessback to summary
public SqmPath<?> resolveIndexedAccess(SqmExpression<?> selector, boolean isTerminal, SqmCreationState creationState)

Implements org.hibernate.query.hql.spi.SemanticPathPart.resolveIndexedAccess.

Annotations
@Override
resolvePathPartback to summary
public SemanticPathPart resolvePathPart(String name, boolean isTerminal, SqmCreationState creationState)

Implements org.hibernate.query.hql.spi.SemanticPathPart.resolvePathPart.

Annotations
@Override