-->
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.  [ 2 posts ] 
Author Message
 Post subject: help with left join!!
PostPosted: Thu Jul 21, 2005 4:44 pm 
Newbie

Joined: Fri Jun 03, 2005 3:40 pm
Posts: 7
These are my tables. I need to retrieve all Persons and their pets(if they have). How can I do that?
i tried:


how can i do that? i tried a few different sql and stil didnĀ“t make it!!


Person====
ID
NAME
AGE

PET====
ID
NAME
Person


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 6:02 pm 
Senior
Senior

Joined: Tue Jun 21, 2005 10:18 am
Posts: 135
Location: South Carolina, USA
Just a shot in the dark (I'm assuming you wanted HQL, not SQL):
Code:
from Person p left join fetch p.pets

But then, I am making guesses here about what your objects look like. We could use a little more information if this doesn't answer your question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.