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/Development/Incubator/Extensions/FetchPlan

Extensions Incubator: FetchPlan

This incubator (bug 288307) is intended to develop the idea of fully specifying what is returned from a query when it is executed. Users often need to ensure a resulting entity graph has required attributed and relationships populated so that the result can be serialized. A FetchPlan allows the user to specify which children relationships and attributes need to be populated and then during the post processing of the query results these attributes are loaded.

Requirements

Incubator Development and Download

The incubator project is available in SVN @ http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/incubator/extensions/trunk/org.eclipse.persistence.example.jpa.fetchplan

The incubator is current being developed with dependencies on two example projects from trunk

The compile dependencies are configured on the org.eclipse.persistence.example.jpa.common project assuming that you have EclipseLink's trunk development projects checked out. If you do not, then remove the project dependencies and make this project depend on libraries that include your EclipseLink implementation, javax.persistence, and the JDBC driver you will use. Make sure this project also exports these dependencies.

Download the JAR

Just the implementation required to try this incubator in your development is available @ eclipselink-extension-incubator_fetchplan.jar. Note: This jar is manually updated and maintained as a best effort of the incubator developers

Feedback

If you encounter any issues, have a suggestion, or would like to contribute to this incubator please file a bug with the summary prefixed with [FetchPlan]].

Usage Examples

EntityManager em = getEntityManager();
 
Query query = em.createQuery("SELECT e FROM Employee e WHERE e.gender IS NOT NULL");
 
FetchPlan fetchPlan = FetchPlanHelper.create(query);
fetchPlan.addFetchItem("e.address");
fetchPlan.addFetchItem("e.phoneNumbers");
 
List<Employee> emps = query.getResultList();

Design

... coming soon

Integration Notes

During the design and implementation of this extension the final design for how this extension can be incorporated into the main project source is ongoing. The following are design notes captured to assist in this process when the incubator reaches maturity.

Back to the top