Nested "treat (x as Type)" aren’t supported

Description

Section 4.4.4.1 of the JPA 2.1 specification (which gives the syntax for path expressions) explicitly allows nested "treat as" statements, yet they are not currently supported by Hibernate. The following test case throws a QuerySyntaxExpression:

TreatTest.java

The stacktrace of the thrown expression is:

My pull request for added support for nested "treat as" just after a "member of" construction, but it is currently the only place where nested treat as are supported. This new bug report is in order to support them everywhere where they should be allowed.

Environment

None

Status

Assignee

Unassigned

Reporter

Etienne Miret

Fix versions

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure