-->
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: hql eager fetch query help
PostPosted: Fri Jun 02, 2006 7:07 pm 
Newbie

Joined: Fri Jun 02, 2006 6:51 pm
Posts: 1
I'm sorry if this post is a little on the obscure side, i'm a beginner to hibernate so please bare with me. I'm working with jboss on a booking system which has 3 entities which are stored in a mysql dbase.
I need to do an eager fetch using a query like

SELECT t from Tutor t LEFT JOIN FETCH t.appointments WHERE t.id = :bindId

however where this query selects all the tutor objects and eagerly fetches the appropriate appointment objects i need a query which selects Tutor objects and eagerly fetches both appointment and student objects.


The below query worked however it doubled the objects.

SELECT t from Tutor t LEFT JOIN FETCH t.appointments LEFT JOIN FETCH t.students WHERE t.id = :bindId

any help would be greatly appreciated. =]


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.