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.  [ 3 posts ] 
Author Message
 Post subject: HQL syntax for fetch
PostPosted: Fri Sep 29, 2006 5:46 am 
Newbie

Joined: Thu Aug 31, 2006 7:56 am
Posts: 14
I use the following to force the read of Rep on read on Order.
Code:
from Order ord left join fetch ord.Rep rep


I now want to force the read of RepGroup (Order.Rep.RepGroup), but I dont know the syntax for the second 'join fetch'


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 29, 2006 7:50 am 
Beginner
Beginner

Joined: Thu Aug 24, 2006 6:01 am
Posts: 49
Location: sophia-antipolis, France
You can just add a join fetch one after the other for each relation you want to fetch:

Code:
from Order ord
left join fetch ord.Rep rep
left join fetch ord.Rep.RepGroup


You just have to be careful to use join fetch on only one collection if any.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 05, 2006 5:45 am 
Newbie

Joined: Thu Aug 31, 2006 7:56 am
Posts: 14
Perfect, thanks.


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

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.