ClassCastExpectation in LoadQueryJoinAndFetchProcessor if Embeddables are used with Joined Inheritence strategy

Description

After updating from Hibernate 5.1 to Hibernate 5.3 we the following exception when deploying our application in Wildfly:

After some investigation we found out that this is caused by the combination of using the Joined strategy for inheritence and using the same embedded entity multiple times in entities in the inheritance hierarchy. A test case using the Hibernate Test Case template can be found here: https://github.com/jpdigital/hibernate-test-case-templates/tree/master/orm/hibernate-orm-5 (in the JPAUnitTestCase).

I executed the test with different versions of Hibernate. 5.1 works, starting with 5.2 the expectation is thrown.

Environment

None

Assignee

Unassigned

Reporter

Jens Pelzetter

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.1.17

Components

Affects versions

Priority

Major
Configure