Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: for the plan.

Jump to: navigation, search


In addition to JPQL, EclipseLink defines a rich DatabaseQuery and Expression criteria API.


Using JpaEntityManager createQuery() API

import javax.persistence.Query;
import org.eclipse.persistence.expressions.*;
import org.eclipse.persistence.queries.ReadAllQuery;
ExpressionBuilder builder = new ExpressionBuilder();
ReadAllQuery databaseQuery = new ReadAllQuery(Employee.class, builder);
Query query = ((JpaEntityManager)entityManager.getDelegate()).createQuery(databaseQuery);
List result = query.getResultList();

This JpaEntityManager API was added in EclipseLink 1.1, in EclipseLink 1.0, the JpaQuery method setDatabaseQuery() could be used.

Back to the top