Class NumericResolver
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
org.eclipse.persistence.jpa.jpql.tools.resolver.NumericResolver
This
Resolver
is responsible to return the numeric type for a list of Resolvers
.
The result of a CASE expression, COALESCE expression, NULLIF expression, or arithmetic expression (+, -, *, /) is determined by applying the following rule to its operands.
- If there is an operand of type
Double
ordouble
, the result of the operation is of typeDouble
; - otherwise, if there is an operand of type
Float
orfloat
, the result of the operation is of typeFloat
; - otherwise, if there is an operand of type
BigDecimal
, the result of the operation is of typeBigDecimal
; - otherwise, if there is an operand of type
BigInteger
, the result of the operation is of typeBigInteger
, unless the operator is / (division), in which case the numeric result type is not further defined; - otherwise, if there is an operand of type
Long
orlong
, the result of the operation is of typeLong
, unless the operator is / (division), in which case the numeric result type is not further defined; - otherwise, if there is an operand of integral type, the result of the operation is of type
Integer
, unless the operator is / (division), in which case the numeric result type is not further defined.
- Since:
- 2.3
- Version:
- 2.5
-
Constructor Summary
ConstructorDescriptionNumericResolver
(Resolver parent, Collection<Resolver> typeResolvers) Creates a newNumericResolver
.NumericResolver
(Resolver parent, Resolver resolver) Creates a newNumericResolver
. -
Method Summary
Modifier and TypeMethodDescriptionprotected IType
protected ITypeDeclaration
Resolves theITypeDeclaration
of the property handled by thisResolver
.Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, checkParent, getChild, getManagedType, getMapping, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
-
Constructor Details
-
NumericResolver
Creates a newNumericResolver
. -
NumericResolver
Creates a newNumericResolver
.
-
-
Method Details
-
buildType
Description copied from class:Resolver
-
buildTypeDeclaration
Description copied from class:Resolver
Resolves theITypeDeclaration
of the property handled by thisResolver
.- Specified by:
buildTypeDeclaration
in classResolver
- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-