|
When attempting to select a property from a sub-class of an entity, having used the 'treat' method, an exception is thrown.
Please find attached a test case of the problem, which results in an error occurring.
Using debug to determine what is causing the issue, it was found that the generated query tries to perform 'SELECT null FROM <table>'.
The JPA specification has been checked to confirm that not being able to 'select' a property when using 'treat' is an issue; see Section 4.4.9 - Downcasting of the JPA 2.1 specification. This query has also been tested using EclipseLink (2.5.1), and the behaviour is as expected - the selected property is returned.
The following exception occurs when the query is executed:
|