Class SqmHqlNumericLiteral<N extends Number>
- java.lang.Object
-
- org.hibernate.query.sqm.tree.AbstractSqmNode
-
- org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement<T>
-
- org.hibernate.query.sqm.tree.jpa.AbstractJpaSelection<T>
-
- org.hibernate.query.sqm.tree.expression.AbstractSqmExpression<T>
-
- org.hibernate.query.sqm.tree.expression.SqmLiteral<N>
-
- org.hibernate.query.sqm.tree.expression.SqmHqlNumericLiteral<N>
-
- All Implemented Interfaces:
Expression<N>
,Selection<N>
,TupleElement<N>
,Serializable
,JpaCriteriaNode
,JpaExpression<N>
,JpaSelection<N>
,JpaTupleElement<N>
,SqmExpression<N>
,SqmSelectableNode<N>
,SqmExpressibleAccessor<N>
,SqmNode
,SqmTypedNode<N>
,SqmVisitableNode
public class SqmHqlNumericLiteral<N extends Number> extends SqmLiteral<N>
Used to model numeric literals found in HQL queries. Used instead ofSqmLiteral
which would require parsing the literal value to the specified number type to avoid loss of precision due to Float and Double being non-exact types.- See Also:
- Serialized Form
- API Note:
- Only used for HQL literals because we do not have this problem with criteria queries where the value given us by user would already be typed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SqmHqlNumericLiteral.TypeException
-
Constructor Summary
Constructors Constructor Description SqmHqlNumericLiteral(String literalValue, BasicDomainType<N> type, NodeBuilder criteriaBuilder)
SqmHqlNumericLiteral(String literalValue, NumericTypeCategory typeCategory, BasicDomainType<N> type, NodeBuilder criteriaBuilder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <X> X
accept(SemanticQueryWalker<X> walker)
Accept the walker per visitationvoid
appendHqlString(StringBuilder sb)
String
asLoggableText()
SqmHqlNumericLiteral<N>
copy(SqmCopyContext context)
BasicDomainType<N>
getExpressible()
N
getLiteralValue()
BasicDomainType<N>
getNodeType()
The expression's type.NumericTypeCategory
getTypeCategory()
String
getUnparsedLiteralValue()
-
Methods inherited from class org.hibernate.query.sqm.tree.expression.SqmLiteral
appendHqlString
-
Methods inherited from class org.hibernate.query.sqm.tree.expression.AbstractSqmExpression
applyInferableType, as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, equalTo, equalTo, getJavaTypeDescriptor, in, in, in, in, internalApplyInferableType, isNotNull, isNull, nodeBuilder
-
Methods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaSelection
alias, getSelectionItems, isCompoundSelection
-
Methods inherited from class org.hibernate.query.sqm.tree.jpa.AbstractJpaTupleElement
copyTo, getAlias, setAlias, setExpressibleType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.query.criteria.JpaSelection
alias, getCompoundSelectionItems, getSelectionItems
-
Methods inherited from interface org.hibernate.query.criteria.JpaTupleElement
getJavaType, getJavaTypeName, isEnum
-
Methods inherited from interface jakarta.persistence.criteria.Selection
isCompoundSelection
-
Methods inherited from interface org.hibernate.query.sqm.tree.expression.SqmExpression
cast, castAs, visitSubSelectableNodes
-
Methods inherited from interface org.hibernate.query.sqm.tree.select.SqmSelectableNode
getTupleLength
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmTypedNode
getNodeJavaType
-
Methods inherited from interface org.hibernate.query.sqm.tree.SqmVisitableNode
toHqlString
-
Methods inherited from interface jakarta.persistence.TupleElement
getAlias
-
-
-
-
Constructor Detail
-
SqmHqlNumericLiteral
public SqmHqlNumericLiteral(String literalValue, BasicDomainType<N> type, NodeBuilder criteriaBuilder)
-
SqmHqlNumericLiteral
public SqmHqlNumericLiteral(String literalValue, NumericTypeCategory typeCategory, BasicDomainType<N> type, NodeBuilder criteriaBuilder)
-
-
Method Detail
-
getUnparsedLiteralValue
public String getUnparsedLiteralValue()
-
getLiteralValue
public N getLiteralValue()
- Overrides:
getLiteralValue
in classSqmLiteral<N extends Number>
-
getTypeCategory
public NumericTypeCategory getTypeCategory()
-
getNodeType
public BasicDomainType<N> getNodeType()
Description copied from interface:SqmExpression
The expression's type.Can change as a result of calls to
SqmExpression.applyInferableType(org.hibernate.query.sqm.SqmExpressible<?>)
- Specified by:
getNodeType
in interfaceSqmExpression<N extends Number>
- Specified by:
getNodeType
in interfaceSqmTypedNode<N extends Number>
- Overrides:
getNodeType
in classAbstractJpaTupleElement<N extends Number>
-
getExpressible
public BasicDomainType<N> getExpressible()
-
accept
public <X> X accept(SemanticQueryWalker<X> walker)
Description copied from interface:SqmVisitableNode
Accept the walker per visitation- Specified by:
accept
in interfaceSqmVisitableNode
- Overrides:
accept
in classSqmLiteral<N extends Number>
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlString
in interfaceSqmVisitableNode
- Overrides:
appendHqlString
in classSqmLiteral<N extends Number>
-
asLoggableText
public String asLoggableText()
- Specified by:
asLoggableText
in interfaceSqmNode
- Overrides:
asLoggableText
in classSqmLiteral<N extends Number>
-
copy
public SqmHqlNumericLiteral<N> copy(SqmCopyContext context)
- Specified by:
copy
in interfaceSqmExpression<N extends Number>
- Specified by:
copy
in interfaceSqmNode
- Specified by:
copy
in interfaceSqmSelectableNode<N extends Number>
- Specified by:
copy
in interfaceSqmTypedNode<N extends Number>
- Overrides:
copy
in classSqmLiteral<N extends Number>
-
-