Class NumericResolver
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.NumericResolver
-
public class NumericResolver extends Resolver
ThisResolver
is responsible to return the numeric type for a list ofResolvers
.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.
- Version:
- 2.5
- Author:
- Pascal Filion
- Since:
- 2.3
- If there is an operand of type
-
-
Constructor Summary
Constructors Constructor Description NumericResolver(Resolver parent, java.util.Collection<Resolver> typeResolvers)
Creates a newNumericResolver
.NumericResolver(Resolver parent, Resolver resolver)
Creates a newNumericResolver
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IType
buildType()
protected ITypeDeclaration
buildTypeDeclaration()
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
-
-
-
-
Method Detail
-
buildType
protected IType buildType()
-
buildTypeDeclaration
protected ITypeDeclaration buildTypeDeclaration()
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
-
-