Hi there,
i am currently migrating from hibernate 3 to 4. I managed to sort out the dependencies but i am facing the popular : "org.hibernate.QueryException: query specified join fetching, but the owner of the fetched association was not present in the select list..." issue . I used to do the below in order to force hibernate to fetch the entire object and it's collection properties i.e. an Employee with many Departments and the address of each department.
So in hsql i had something like :
select e from Employee as e left join fetch e.department left join fetch e.department.address where e.id= ....
This worked fine but in new hibernate i can only fetch the properties that belong directly to the employee object and not the department. So what i would like is to get all properties because the session is closed after the query and lazy obviously raises an exception.
I would really appreciate your help in sorting this out.
Kind Regards
|