Class AbsExpression

  • All Implemented Interfaces:
    Expression

    public final class AbsExpression
    extends AbstractSingleEncapsulatedExpression
    The ABS function removes the minus sign from a specified argument and returns the absolute value, which is always a positive number or zero.

    This is one of the JPQL arithmetic functions. The ABS function takes a numeric argument and returns a number (integer, float, or double) of the same type as the argument to the function.

    JPA 1.0, 2.0:

    BNF: expression ::= ABS(simple_arithmetic_expression)

    JPA 2.1:

    BNF: expression ::= ABS(arithmetic_expression)

    Example: SELECT DISTINCT o FROM Order o WHERE o.totalPrice > ABS(:dbl)

    Version:
    2.5
    Author:
    Pascal Filion
    Since:
    2.3