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/DesignDocs/350727"

(New page: <div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div> = Design Specification: <feature-name> = [http://bugs.eclipse.org/350727 ER 350727] == Document His...)
 
(Document History)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div>
 
<div style="margin:5px;float:right;border:1px solid #000000;padding:5px">__TOC__</div>
= Design Specification: <feature-name> =
+
= Design Specification: ConstructorResult support in SQLResultSetMappings  =
  
 
[http://bugs.eclipse.org/350727 ER 350727]
 
[http://bugs.eclipse.org/350727 ER 350727]
Line 11: Line 11:
 
! Version Description & Notes
 
! Version Description & Notes
 
|-  
 
|-  
|  
+
| 08 November 2011
|  
+
| Gordon Yorke
|  
+
| Initial document creation
 +
|-
 +
| 04 September 2012
 +
| Guy Peletier
 +
| Feature competed
 
|}
 
|}
  
 
== Project overview ==
 
== Project overview ==
  
Overview of the project/featureWhy is it desired, what are its goals.
+
The JPA specification is adding support for returning new Object instances from native query resultsKnow as "constructor" queries JPQL has supported returning Objects built with query results but until now the SQLResultSetMappings had no support for Constructor results and only Managed objects or primitive results could be returned from a native SQL query.
 
+
Goals:
+
* goal 1
+
* goal 2
+
  
 
== Concepts ==
 
== Concepts ==
 +
A constructor query takes the results of a query and calls a Constructor designated in the syntax of the JPQL SELECT clause with the designated arguments returning the newly build objects as the query result.  For example : SELECT new ObjectA(e.firstName) FROM Employee e.
  
Present any concepts relevant to the feature.
+
SQLResultSetMappings for the metadata for mapping the result of a native SQL query to a Managed object of the persistence unit.  With the addition of the ConstructorResult element the SQLResultSetMapping now supports mapping native SQL results to non-managed objects.
  
 
== Requirements ==
 
== Requirements ==
 
+
Support the ConstructorResult element within the SQLResultSetMapping.
The following sections will expand the goals of this project into more concrete requirements.
+
  
 
== Design Constraints ==
 
== Design Constraints ==

Latest revision as of 09:16, 10 September 2012

Design Specification: ConstructorResult support in SQLResultSetMappings

ER 350727

Document History

Date Author Version Description & Notes
08 November 2011 Gordon Yorke Initial document creation
04 September 2012 Guy Peletier Feature competed

Project overview

The JPA specification is adding support for returning new Object instances from native query results. Know as "constructor" queries JPQL has supported returning Objects built with query results but until now the SQLResultSetMappings had no support for Constructor results and only Managed objects or primitive results could be returned from a native SQL query.

Concepts

A constructor query takes the results of a query and calls a Constructor designated in the syntax of the JPQL SELECT clause with the designated arguments returning the newly build objects as the query result. For example : SELECT new ObjectA(e.firstName) FROM Employee e.

SQLResultSetMappings for the metadata for mapping the result of a native SQL query to a Managed object of the persistence unit. With the addition of the ConstructorResult element the SQLResultSetMapping now supports mapping native SQL results to non-managed objects.

Requirements

Support the ConstructorResult element within the SQLResultSetMapping.

Design Constraints

Design / Functionality

Testing

API

GUI

Config files

Documentation

Open Issues

This section lists the open issues that are still pending that must be decided prior to fully implementing this project's requirements.

Issue # Owner Description / Notes

Decisions

This section lists decisions made. These are intended to document the resolution of open issues or constraints added to the project that are important.

Issue # Description / Notes Decision

Future Considerations

During the research for this project the following items were identified as out of scope but are captured here as potential future enhancements. If agreed upon during the review process these should be logged in the bug system.

Back to the top