JPA Query Expressions (JPQL / Criteria)

Query expressions are the foundations on which JPQL and criteria queries are built.

Every query consists of clauses - SELECT, FROM, WHERE, GROUP BY, HAVING and ORDER BY, and each clause consists of JPQL / Criteria query 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 / Criteria queries support the following operators (in order of decreasing precedence):

In addition, JPA queries support predefined functions, which are also described in this section.

Organization of this Section

This section contains the following pages:

Detailed explanations on how to build criteria query expressions are provided as follows:

This documentation explains how to use JPA in the context of the ObjectDB Object Database but mostly relevant also for ORM JPA implementations, such as Hibernate (and HQL), EclipseLink, TopLink, OpenJPA and DataNucleus. ObjectDB is not an ORM JPA implementation but an Object Database (ODBMS) for Java with built in JPA 2 support.