Skip Headers

# Understanding the Expression Framework

Previous

Next

The TopLink expression framework provides methods through the following classes:

- The `Expression` class provides most general functions, such as `toUpperCase`.

- The `ExpressionMath` class supplies mathematical methods.

Example: Using the Expression Class illustrates how to use the `Expression` class.

Using the Expression Class

    expressionBuilder.get("lastName").equal("Smith");

Example: Using the ExpressionMath Class illustrates how to use the `ExpressionMath` class.

Using the ExpressionMath Class

    ExpressionMath.abs(ExpressionMath.subtract(emp.get("salary"),
    emp.get("spouse").get("salary")).greaterThan(10000)

This division of functionality enables TopLink expressions to provide similar mathematical functionality to the `java.lang.Math` class, but keeps both the `Expression` and `ExpressionMath` classes from becoming unnecessarily complex.