LazyLoad with singleTable inheritance don't use discriminatorValue

Description

please see the attached test case. Execute it via:

With singleTable inheritance lazyLoad is triggered, without the discriminator value in the SQL Statement. In consequence there are wrong mapped objects in the collection. In the later, if the entityManager knows the wrong mapped object and the second collection triggerLazy load, there is a org.hibernate.WrongClassException thrown.

With JoinFetch in a query, the discriminator value is applied as expected.

Environment

None

Assignee

Unassigned

Reporter

Florian Kern

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Critical
Configure