please see the attached test case. Execute it via:
{noformat}mvn test{noformat}
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.
Without LazyLoad and With JoinFetch it works in a query, the discriminator value is applied as expected. |
|