-->
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: one to many retrieval
PostPosted: Sat Dec 20, 2003 3:57 pm 
Newbie

Joined: Fri Dec 19, 2003 1:08 pm
Posts: 11
Don't think I'm heading in the right direction:

Trying to convert:
SELECT p.* FROM Projects p INNER JOIN ProjectMembers pm ON pm.pid = p.pid AND pm.username = 'xyz'

to hibernate:
List list = session.find("from Projectmembers where username = 'xyz'");
List pms = session.createCriteria(Projects.class).add(Expression.in("projectmembers", list) ).list();

Iterator it = pms.iterator();


Any pointers appreciated. Thank you


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 20, 2003 4:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
session.find("from Projects p inner join p.members as member where member.username = 'xyz'");


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 20, 2003 5:23 pm 
Newbie

Joined: Fri Dec 19, 2003 1:08 pm
Posts: 11
Thank you!


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.