JPA Query Expressions (JPQL / Criteria)

JPQL and criteria queries are built on query expressions.

Every query consists of clauses, such as SELECT, FROM, WHERE, GROUP BY, HAVING, and ORDER BY. Each clause is composed of JPQL or Criteria API expressions.

Atomic expressions

The atomic query expressions are:

Every query expression consists of at least one atomic component. More complex query expressions are built by combining atomic expressions with operators and functions.

Operators and functions

JPQL and the Criteria API support the following operators, listed in order of decreasing precedence:

JPA queries also support predefined functions, which this section describes.

Organization of this section

This section contains the following pages:

Detailed explanations of how to build Criteria API expressions are provided on the following pages: