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

Difference between revisions of "EclipseLink/Development/JPA-RS"

(Open Issues)
 
(11 intermediate revisions by one other user not shown)
Line 4: Line 4:
 
The EclipseLink 2.4.0 release introduced JPA-RS allowing developers to easily expose persistence units over REST (JAX-RS). The intent was to allow clients (HTML5/JS, Mobile, JavaSE/JavaFX) to easily access persistent data over REST with JSON or XML. This page tracks the ongoing feature development of JPA-RS including planned features for upcoming releases as well as a back-log of future enhancements. The details of each item will be tracked within its bug and associated wiki pages or documents.
 
The EclipseLink 2.4.0 release introduced JPA-RS allowing developers to easily expose persistence units over REST (JAX-RS). The intent was to allow clients (HTML5/JS, Mobile, JavaSE/JavaFX) to easily access persistent data over REST with JSON or XML. This page tracks the ongoing feature development of JPA-RS including planned features for upcoming releases as well as a back-log of future enhancements. The details of each item will be tracked within its bug and associated wiki pages or documents.
  
See the [http://wiki.eclipse.org/EclipseLink/Development/2.4.0/JPA-RS/REST-API API in Development] here.
+
See the [http://www.eclipse.org/eclipselink/documentation/2.4/solutions/restful_jpa003.htm#CHDEGJIG JPA-RS API Documentation version 2.4.0].
  
== Planned Features/Bugs ==
+
== Project Planning ==
  
{|{{BMTableStyle}}
+
See [https://bugs.eclipse.org/bugs/buglist.cgi?order=Importance&list_id=3106294&classification=RT&status_whiteboard_type=allwordssubstr&query_format=advanced&status_whiteboard=jpa-rs&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&product=EclipseLink BugDB] for a prioritized list of features and bugs along with their target releases.
|-{{BMTHStyle}}
+
! Bug
+
! Issue
+
! Description
+
! Status
+
! Target Release
+
|-
+
| {{bug|387313}} || PUT/POST ||Cannot create an entity containing reference (1-to-1) to another entity, using JPA-RS with static PU  || Fixed || 2.4.1
+
|-
+
| {{bug|387636}} || POST ||Swallowed exception in PersistenceContext::updateOrAddAttribute || Fixed || 2.4.1 
+
|-
+
| {{bug|389295}} || JPA-RS: Disable EJB invocation by default || The current implementation enables EJB invocation all the time.  We should make that functionality configurable and "off" by default. || not started || 2.4.1
+
|-
+
| {{bug|389888}} || JPA-RS: Pass-by-Reference, Pass-by-value || allow JPA_RS objects to be passed by value for relationships || in progress || 2.4.1
+
|-
+
| {{bug|390004}} || JPA-RS: Interaction with model classes with or without JAXB annotations || By default JPA-RS should respect existing JAXB annotations in applications' model classes. If the application model is not (JAXB) annotated, especially for cylic references, the JPA-RS should detect these from mappings and implement XMLInverseReference behaviour. || not started || 2.4.1
+
|}
+
  
== Proposed Features ==
+
== Open Issues  ==
  
{|{{BMTableStyle}}
+
The following open issues have been recorded and not yet materialized as bugs. They represent items we should consider whether to document, and/or somehow address in code.
|-{{BMTHStyle}}
+
! Bug
+
! Issue
+
! Description
+
|-
+
| {{bug|389881}} || Config File || Add an optional XML configuration which when provided controls which persistence units are made available through JPA_RS and what operations within each persistence unit are made available. This configuration file will also control extended functionality where any existing or custom JPA-RS operation can have a custom handler specified or a handler can be specified to intercept all operations or all unsupported requests.
+
 
+
 
+
There are also some other configurable properties that are required to be set during the deployment of an application using JPA-RS. These properties include (but might not be limited to):
+
*base URI of the service,
+
*datasource properties/name, etc...
+
 
+
 
+
The application developer will also need a way (some sort of API) to pass these properties to the JPA-RS, perhaps as part of bootstrapPersistenceContext ???
+
 
+
|-
+
| {{bug|387218}}|| Pagination || Support pagination (count, first, max, getNext<N>) using URI query parameters.
+
|-
+
| {{bug|389883}} || Partial Entities || Add support for clients being able to request partial entities and graphs that will reduce the payload size or reduce the number of requests required to retrieve and to pass back an entity graph.
+
 
+
|-
+
| {{bug|389884}} || Detailed error response || Add support for clients being able to get more information in an error response. Please note that this is an addition to the HTTP error/status code that is currently being returned in response. The JPA-RS would return an error message in the body of the response that would contain an (EclipseLink specific) error code and description. As an example, an error response would look like :
+
{
+
  "code":"1245",
+
  "description":"invalid query"
+
}
+
 
+
 
+
With the existing implementation, you will get following error response if you try to read a non-existing entity, even if you want the response back in JSON format. I think returning error in the format suggested above will make the error handling easier.
+
 
+
 
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>GlassFish Server Open Source Edition 3.1.2 - Error report</title><style type="text/css"><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 404 - Not Found</h1><hr/><p><b>type</b> Status report</p><p><b>message</b>Not Found</p><p><b>description</b>The requested resource (Not Found) is not available.</p><hr/><h2>GlassFish Server Open Source Edition 3.1.2</h2></body></html>
+
|-
+
| {{bug|389889}} || HATEOAS Enhancements || Improve support for discovery of available operations in JPA-RS application
+
|-
+
| {{bug|389890 }} || Refactor JPA-RS jar to minimize contents || Move the majority of JPA-RS functionality into one of our main bundles (e.g. the org.eclipse.persistence.jpa bundle)
+
|}
+
 
+
== Open Issues  ==
+
  
*Fully Qualified vs. Relative URIs in responses - Should we return a fully qualified URL starting with "http://", or should we use a relative URL that omits the application path like "/persistence/...".
 
 
*Bidirectional relationships and cycles - how do we pass bidirectional relationships in JSON/XML. There are limitations related to how you can expect to see responses in JSON/XML - e.g. XMLInverseReference needs to be specified somewhere for bidirecitonal relationships.<br>
 
*Bidirectional relationships and cycles - how do we pass bidirectional relationships in JSON/XML. There are limitations related to how you can expect to see responses in JSON/XML - e.g. XMLInverseReference needs to be specified somewhere for bidirecitonal relationships.<br>
 
*Can we remove the need for client to send the name of the attribute that makes up the opposite side of the relationship in the JPA-RS POST message ([[EclipseLink/Development/2.4.0/JPA-RS/REST-API#ADD]]) for adding a member to a collection and let the JAP-RS to figure it out on the server side ?<br>
 
*Can we remove the need for client to send the name of the attribute that makes up the opposite side of the relationship in the JPA-RS POST message ([[EclipseLink/Development/2.4.0/JPA-RS/REST-API#ADD]]) for adding a member to a collection and let the JAP-RS to figure it out on the server side ?<br>
 
* ManyToMany mappings are complex to map in JAXB.  They will not marshall correctly in JPA-RS without being JAXB mapped with either annotations of xml
 
* ManyToMany mappings are complex to map in JAXB.  They will not marshall correctly in JPA-RS without being JAXB mapped with either annotations of xml
* To allow sending links without any values, the JAXBContext will assume any numeric direct mapping has a default null value of 0.  i.e. Configurations that allow 0 as a non-null value are not supported.
 
 
* The REST API to setOrAddAttributes will not work when using FIELD access with Weaved Change Tracking and Internal Weaving, because there is no way to have EclipseLink set the value field and have changes tracked.
 
* The REST API to setOrAddAttributes will not work when using FIELD access with Weaved Change Tracking and Internal Weaving, because there is no way to have EclipseLink set the value field and have changes tracked.
 
* The REST API to create(PUT) will not set both sides of bidirectional(one-to-many, one-to-one) relationships.
 
* The REST API to create(PUT) will not set both sides of bidirectional(one-to-many, one-to-one) relationships.

Latest revision as of 10:09, 25 April 2013

EclipseLink JPA-RS Development

The EclipseLink 2.4.0 release introduced JPA-RS allowing developers to easily expose persistence units over REST (JAX-RS). The intent was to allow clients (HTML5/JS, Mobile, JavaSE/JavaFX) to easily access persistent data over REST with JSON or XML. This page tracks the ongoing feature development of JPA-RS including planned features for upcoming releases as well as a back-log of future enhancements. The details of each item will be tracked within its bug and associated wiki pages or documents.

See the JPA-RS API Documentation version 2.4.0.

Project Planning

See BugDB for a prioritized list of features and bugs along with their target releases.

Open Issues

The following open issues have been recorded and not yet materialized as bugs. They represent items we should consider whether to document, and/or somehow address in code.

  • Bidirectional relationships and cycles - how do we pass bidirectional relationships in JSON/XML. There are limitations related to how you can expect to see responses in JSON/XML - e.g. XMLInverseReference needs to be specified somewhere for bidirecitonal relationships.
  • Can we remove the need for client to send the name of the attribute that makes up the opposite side of the relationship in the JPA-RS POST message (EclipseLink/Development/2.4.0/JPA-RS/REST-API#ADD) for adding a member to a collection and let the JAP-RS to figure it out on the server side ?
  • ManyToMany mappings are complex to map in JAXB. They will not marshall correctly in JPA-RS without being JAXB mapped with either annotations of xml
  • The REST API to setOrAddAttributes will not work when using FIELD access with Weaved Change Tracking and Internal Weaving, because there is no way to have EclipseLink set the value field and have changes tracked.
  • The REST API to create(PUT) will not set both sides of bidirectional(one-to-many, one-to-one) relationships.

Back to the top