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 ofSqmLiteralwhich 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 classSqmHqlNumericLiteral.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> Xaccept(SemanticQueryWalker<X> walker)Accept the walker per visitationvoidappendHqlString(StringBuilder sb)StringasLoggableText()SqmHqlNumericLiteral<N>copy(SqmCopyContext context)BasicDomainType<N>getExpressible()NgetLiteralValue()BasicDomainType<N>getNodeType()The expression's type.NumericTypeCategorygetTypeCategory()StringgetUnparsedLiteralValue()-
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:
getLiteralValuein classSqmLiteral<N extends Number>
-
getTypeCategory
public NumericTypeCategory getTypeCategory()
-
getNodeType
public BasicDomainType<N> getNodeType()
Description copied from interface:SqmExpressionThe expression's type.Can change as a result of calls to
SqmExpression.applyInferableType(org.hibernate.query.sqm.SqmExpressible<?>)- Specified by:
getNodeTypein interfaceSqmExpression<N extends Number>- Specified by:
getNodeTypein interfaceSqmTypedNode<N extends Number>- Overrides:
getNodeTypein classAbstractJpaTupleElement<N extends Number>
-
getExpressible
public BasicDomainType<N> getExpressible()
-
accept
public <X> X accept(SemanticQueryWalker<X> walker)
Description copied from interface:SqmVisitableNodeAccept the walker per visitation- Specified by:
acceptin interfaceSqmVisitableNode- Overrides:
acceptin classSqmLiteral<N extends Number>
-
appendHqlString
public void appendHqlString(StringBuilder sb)
- Specified by:
appendHqlStringin interfaceSqmVisitableNode- Overrides:
appendHqlStringin classSqmLiteral<N extends Number>
-
asLoggableText
public String asLoggableText()
- Specified by:
asLoggableTextin interfaceSqmNode- Overrides:
asLoggableTextin classSqmLiteral<N extends Number>
-
copy
public SqmHqlNumericLiteral<N> copy(SqmCopyContext context)
- Specified by:
copyin interfaceSqmExpression<N extends Number>- Specified by:
copyin interfaceSqmNode- Specified by:
copyin interfaceSqmSelectableNode<N extends Number>- Specified by:
copyin interfaceSqmTypedNode<N extends Number>- Overrides:
copyin classSqmLiteral<N extends Number>
-
-