The EclipseLink 2.4.0 release is planning to include an easy to use RESTful interface for interacting with JPA persistence units. This page captures the requirements and design efforts. All feedback is welcome using the discussion page or through the bug 362900.
Persistence Unit Access
In order for JPA-RS to access a persistence unit it must be made available through one of the following mechanisms:
- Available on classpath of running JPA-RS instance so standard JPA bootstrapping can find it
- Provisioned: This requires a PUT call to the service to inform it of a PU
- Pass in all of the configuration
- Pass in minimal information with information about where to retrieve additional config from
Using JPA-RS with static PU
The goal is to make enabling of JPA-RS as easy to do as possible.
In order to function in standard JAX-RS solution there must be annotated classes in the deployed WAR.
The JAX-RS reference implementation is Jersey (jersey.java.net). Additional support will be added to leverage Jersey's (add version) planned support for defining JAX-RS applications and resources using their API. The goal here is to allow JPA-RS to be declaratively configured without requiring any additional code to be included in a user's WAR/EAR.
There will be no security implemented with JPA-RS. Users wishing to secure their JPA-RS access should follow standard RESTful securing practices.
By default all entity types CRUD operations and named queries will be exposed by JPA-RS. This must be made configurable so developers can specify what capabilities should be exposed.
In addition to the URI's for all defined named queries and entity types there should be support in JPA-RS to access server side application logic within EJB session beans.