public class BinaryArithmeticOperation<N extends Number> extends ExpressionImpl<N> implements BinaryOperatorExpression<N>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
BinaryArithmeticOperation.Operation |
ParameterContainer.Helper
Constructor and Description |
---|
BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder,
Class<N> resultType,
BinaryArithmeticOperation.Operation operator,
Expression<? extends N> lhs,
Expression<? extends N> rhs)
Creates an arithmethic operation based on 2 expressions.
|
BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder,
Class<N> javaType,
BinaryArithmeticOperation.Operation operator,
Expression<? extends N> lhs,
N rhs)
Creates an arithmethic operation based on an expression and a literal.
|
BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder,
Class<N> javaType,
BinaryArithmeticOperation.Operation operator,
N lhs,
Expression<? extends N> rhs)
Creates an arithmetic operation based on an expression and a literal.
|
Modifier and Type | Method and Description |
---|---|
static Class<? extends Number> |
determineResultType(Class<? extends Number> argument1Type,
Class<? extends Number> argument2Type) |
static Class<? extends Number> |
determineResultType(Class<? extends Number> argument1Type,
Class<? extends Number> argument2Type,
boolean isQuotientOperation) |
static Class<? extends Number> |
determineReturnType(Class<? extends Number> defaultType,
Expression<? extends Number> expression)
Helper for determining the appropriate operation return type based on one of the operands as an expression.
|
static Class<? extends Number> |
determineReturnType(Class<? extends Number> defaultType,
Number numberLiteral)
Helper for determining the appropriate operation return type based on one of the operands as a literal.
|
Expression<? extends N> |
getLeftHandOperand()
Get the left-hand operand.
|
BinaryArithmeticOperation.Operation |
getOperator() |
Expression<? extends N> |
getRightHandOperand()
Get the right-hand operand.
|
void |
registerParameters(ParameterRegistry registry)
Register any parameters contained within this query component with the given registry.
|
String |
render(CriteriaQueryCompiler.RenderingContext renderingContext) |
String |
renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext) |
as, asBigDecimal, asBigInteger, asDouble, asFloat, asInteger, asLong, asString, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, getValueHandlers, isCompoundSelection
forceConversion, getAlias, getJavaType, getValueHandler, resetJavaType, setAlias
criteriaBuilder
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
as, in, in, in, in, isNotNull, isNull
alias, getCompoundSelectionItems, isCompoundSelection
getAlias, getJavaType
getValueHandlers
getValueHandler
public BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder, Class<N> resultType, BinaryArithmeticOperation.Operation operator, Expression<? extends N> lhs, Expression<? extends N> rhs)
criteriaBuilder
- The builder for query components.resultType
- The operation result typeoperator
- The operator (type of operation).lhs
- The left-hand operand.rhs
- The right-hand operandpublic BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder, Class<N> javaType, BinaryArithmeticOperation.Operation operator, Expression<? extends N> lhs, N rhs)
criteriaBuilder
- The builder for query components.javaType
- The operation result typeoperator
- The operator (type of operation).lhs
- The left-hand operandrhs
- The right-hand operand (the literal)public BinaryArithmeticOperation(CriteriaBuilderImpl criteriaBuilder, Class<N> javaType, BinaryArithmeticOperation.Operation operator, N lhs, Expression<? extends N> rhs)
criteriaBuilder
- The builder for query components.javaType
- The operation result typeoperator
- The operator (type of operation).lhs
- The left-hand operand (the literal)rhs
- The right-hand operandpublic static Class<? extends Number> determineResultType(Class<? extends Number> argument1Type, Class<? extends Number> argument2Type)
public static Class<? extends Number> determineResultType(Class<? extends Number> argument1Type, Class<? extends Number> argument2Type, boolean isQuotientOperation)
public static Class<? extends Number> determineReturnType(Class<? extends Number> defaultType, Expression<? extends Number> expression)
defaultType
- The default return type to use if we cannot determine the java type of 'expression' operand.expression
- The operand.public static Class<? extends Number> determineReturnType(Class<? extends Number> defaultType, Number numberLiteral)
defaultType
- The default return type to use if we cannot determine the java type of 'numberLiteral' operand.numberLiteral
- The operand.public BinaryArithmeticOperation.Operation getOperator()
public Expression<? extends N> getRightHandOperand()
getRightHandOperand
in interface BinaryOperatorExpression<N extends Number>
public Expression<? extends N> getLeftHandOperand()
getLeftHandOperand
in interface BinaryOperatorExpression<N extends Number>
public void registerParameters(ParameterRegistry registry)
registerParameters
in interface ParameterContainer
registry
- The parameter registry with which to register.public String render(CriteriaQueryCompiler.RenderingContext renderingContext)
render
in interface Renderable
public String renderProjection(CriteriaQueryCompiler.RenderingContext renderingContext)
renderProjection
in interface Renderable
Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.