|
In a postgres database I have: A User attached with a profile. This profile does not have authorities.
And this HQL request: @Query("from User u " + "inner join fetch u.profile " + "left join fetch u.profile.authorities " + "where u.id = ?1")
With Hibernate 4.3.11: u.profile.authorites throw a 'org.hibernate.LazyLoadingException'.
With Hibernate 4.3.10 u.profile.authorites is empty which is fine.
If there are authorities linked to this profile everything is fine. The problem seems to appear only when there is nothing to fetch.
This can be fixed with the following request: @Query("from User u " + "inner join fetch u.profile p " + //create an alias "left join fetch p.authorities " + // alias used here "where u.id = ?1")
I am wondering if the first request I do is supposed to be valid or if there is an issue in the new version 4.3.11. Thank you very much for your help.
|