-->
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: Hibernate HQL how to?
PostPosted: Fri Mar 26, 2004 6:45 am 
Newbie

Joined: Tue Mar 23, 2004 2:35 pm
Posts: 3
Hello guys can someone tell me how to do the following

Lets us suppose I have a table foo with an M-M relation to table bar.

foo
ID | Name

bar
ID | Name


foo_bar
foo_ID | bar_ID


What would be an HQL query to check if a foo has a bar with ID = x AND
a bar with ID = y


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 26, 2004 3:28 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
from Foo foo where :bar1 in elements(foo.bars) AND :bar2 in elements(foo.bars)

_________________
Emmanuel


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.