When using Inheritance, there are some situations when an uninitialized proxy instance is returned for a query that has a join fetch.
In my scenario I have the following entities: 1. Event 2. DailyTenantEvent which extends Event 3. User 4. SuperUser which extends User
Now if I run the following queries: 1. Find all DailyTenantEvents for a User. 2. Load that SuperUser mentioned in query1. 3. Find all DailyTenantEvents for a User and join fetch the User entity.
For Query 3, an uninitialized proxy is returned for the User entity even though the fetch it mentioned explicitly.
Attaching maven project. Please look at line 76 in HQLQueryJoinFetchTest.java
|