Design Specification: ConstructorResult support in SQLResultSetMappings
|Date||Author||Version Description & Notes|
|08 November 2011||Gordon Yorke||Initial document creation|
|04 September 2012||Guy Peletier||Feature competed|
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.
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.
Support the ConstructorResult element within the SQLResultSetMapping.
Design / Functionality
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|
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|
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.