Actually this issue represents two feature request because the JPA spec does not allow anything other than a simple path in TREAT
join_association_path_expression ::= join_collection_valued_path_expression | join_single_valued_path_expression | TREAT(join_collection_valued_path_expression AS subtype) | TREAT(join_single_valued_path_expression AS subtype) join_collection_valued_path_expression::= identification_variable.
Unknown macro: {single_valued_embeddable_object_field.}
*collection_valued_field join_single_valued_path_expression::= identification_variable.
*single_valued_object_field
In order to support what you wrote, TREAT must allow other treat-ed expressions and also just identification_variable. Also see https://java.net/jira/browse/JPA_SPEC-117
|