Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Examples/JPA/StoredProcedures


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

See:

Oracle stored procedure using OUT CURSOR

 

Using JpaEntityManager createQuery() API to execute a stored procedure

import javax.persistence.Query;
import org.eclipse.persistence.queries.StoredProcedureCall;
import org.eclipse.persistence.queries.ReadAllQuery;
 
ReadAllQuery databaseQuery = new ReadAllQuery(Employee.class);
StoredProcedureCall call = new StoredProcedureCall();
 
Query query = ((JpaEntityManager)entityManager.getDelegate()).createQuery(databaseQuery);
List result = query.getResultList();

Using @NamedStoredProcedureQuery to define a stored procedure

 

Copyright © Eclipse Foundation, Inc. All Rights Reserved.