类 BinaryArithmeticOperation<N extends Number>

    • 构造器详细资料

      • BinaryArithmeticOperation

        public BinaryArithmeticOperation​(CriteriaBuilderImpl criteriaBuilder,
                                         Class<N> resultType,
                                         BinaryArithmeticOperation.Operation operator,
                                         javax.persistence.criteria.Expression<? extends N> lhs,
                                         javax.persistence.criteria.Expression<? extends N> rhs)
        Creates an arithmetic operation based on 2 expressions.
        参数:
        criteriaBuilder - The builder for query components.
        resultType - The operation result type
        operator - The operator (type of operation).
        lhs - The left-hand operand.
        rhs - The right-hand operand
      • BinaryArithmeticOperation

        public BinaryArithmeticOperation​(CriteriaBuilderImpl criteriaBuilder,
                                         Class<N> javaType,
                                         BinaryArithmeticOperation.Operation operator,
                                         javax.persistence.criteria.Expression<? extends N> lhs,
                                         N rhs)
        Creates an arithmetic operation based on an expression and a literal.
        参数:
        criteriaBuilder - The builder for query components.
        javaType - The operation result type
        operator - The operator (type of operation).
        lhs - The left-hand operand
        rhs - The right-hand operand (the literal)
      • BinaryArithmeticOperation

        public BinaryArithmeticOperation​(CriteriaBuilderImpl criteriaBuilder,
                                         Class<N> javaType,
                                         BinaryArithmeticOperation.Operation operator,
                                         N lhs,
                                         javax.persistence.criteria.Expression<? extends N> rhs)
        Creates an arithmetic operation based on an expression and a literal.
        参数:
        criteriaBuilder - The builder for query components.
        javaType - The operation result type
        operator - The operator (type of operation).
        lhs - The left-hand operand (the literal)
        rhs - The right-hand operand
    • 方法详细资料

      • determineResultType

        public static Class<? extends Number> determineResultType​(Class<? extends Number> argument1Type,
                                                                  Class<? extends Number> argument2Type,
                                                                  boolean isQuotientOperation)
      • determineReturnType

        public static Class<? extends Number> determineReturnType​(Class<? extends Number> defaultType,
                                                                  javax.persistence.criteria.Expression<? extends Number> expression)
        Helper for determining the appropriate operation return type based on one of the operands as an expression.
        参数:
        defaultType - The default return type to use if we cannot determine the java type of 'expression' operand.
        expression - The operand.
        返回:
        The appropriate return type.
      • determineReturnType

        public 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.
        参数:
        defaultType - The default return type to use if we cannot determine the java type of 'numberLiteral' operand.
        numberLiteral - The operand.
        返回:
        The appropriate return type.