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/Development/JPA/QueryDownCast
Contents
Enhancement: Query Down Cast
This page captures the requirements, design, and existing functionality for bug ? to enable EclipseLink JPA/ORM developers to define queries on inheritance hierarchies with down casting to specific classes.
Requirements
Work-Arounds
Since this feature will take significant development effort the following suggest work-around options are provided to assist users who require this functionality. If having this is a show-stopper for your project please vote for and add your feedback to bug ?.
Single Class Results
While this may seem obvious it often important to point out all potential solutions. If the query you are executing will only be returning a single type from the inheritance hierarchy then it is important that that be the target type of the query. This will allow you to access all mapped attributes in this class and its mapped parent classes.
Accessing un-mapped attributes using QueryKey for SINGLE_TABLE
When your inheritance hierarchy leverages a common table for multiple mapped classes in the hierarchy it is possible to query for attributes that are not visible in the class you are querying for through the use of query keys.
Solution Design
TBD