-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: setFetchMode syntax for Graph of Object
PostPosted: Tue Sep 21, 2010 1:42 pm 
Newbie

Joined: Tue Sep 21, 2010 1:31 pm
Posts: 5
Hi: Gurus I am having the org.hibernate.LazyInitializationException when I am trying to use the setFetchMode in my criteria query for the graph of objects. I am using Hibernate 3.3.2 with JDK 1.6. Here is my graph of objects and the pseudo code:

class A {
Set<B> b;
Set <C> c;
}

Class C {
set<D> d;
}

createCriteria(A.class);
crit.setFetchMode("b", FetchMode.JOIN);
crit.setFetchMode("c", FetchMode.JOIN);
crit.createCriteria("c").setFetchMode("d", FetchMode.JOIN);

I can successfully load the graph of objects b and c for Object a, but I can not load the graphs of object d for object c and get the LazyInitializationException .

Can some one shed some light what am I doing wrong in my code above.

Regards,
RJ.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.