Skip Headers

# Expression Components

Previous

Next

A simple expression usually consists of the following three parts:

1. The attribute, which represents a mapped attribute or query key of the persistent class

2. The operator, which is an expression method that implements boolean logic, such as `GreaterThan`, `Equal`, or `Like`

3. The constant or comparison, which refers to the value used to select the object

In the following code fragment:

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

- The attribute is `lastName`.

- The operator is `equal`.

- The constant is the string "`Smith`".

The `expressionBuilder` substitutes for the object or objects to be read from the database. In this example, `expressionBuilder` represents employees.

You can use the following components when constructing an `Expression`:

- Boolean Logic

- Database Functions and Operators

- Mathematical Functions

- XMLType Functions

- Platform and User-Defined Functions

- Expressions for One-to-One and Aggregate Object Relationships

- Expressions for Joining and Complex Relationships