ok, I've added a method to my dao to retrieve with a fetch join
Code:
public List getAll(){
return getHibernateTemplate().find("select name from A " +
"join fetch B " +
"join fetch C ");
This produces LazyInitializationException when I attempt to call A.getB()
Looking into Hibernate in Action I read "Hibernate currently limits you to fetching just one collection eagerly". I am using Hibernate 2.1.8 not 3.
If I change my getAll() to
Code:
public List getAll(){
return getHibernateTemplate().find("select name from A " +
"join fetch B " +
"join C ");
then as expected I get LazyInitializationException when I call B.getC().
So then is it fair to say that because of a limitation of Hibernate I need to find an alternative to the much simplier solution of using fetch join?
Thanks.