Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
EclipseLink/DesignDocs/350727
Design Specification: ConstructorResult support in SQLResultSetMappings
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.