-->
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: select on one-two-many relation with multiple restrictions
PostPosted: Tue Oct 24, 2006 3:59 pm 
Beginner
Beginner

Joined: Thu Nov 20, 2003 12:29 pm
Posts: 39
Dear folks,

have a problem which sounds trivial but i just tried and search hours without finding a solution.
Assume following relationship.

Person has a one-two-many relationship to Address, say a list.
Now i have two specific Address's and i want to retrieve all Person's which have both of that Address's. ?

Thats all!
Using hibernate3.
hoping on enlightment..
cheers
Johannes


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 5:05 pm 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
Code:
.add( Restrictions.in("address", CollectionsOfAddress) )


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 5:27 am 
Beginner
Beginner

Joined: Thu Nov 20, 2003 12:29 pm
Posts: 39
passos wrote:
Code:
.add( Restrictions.in("address", CollectionsOfAddress) )


Yes that way i tried but this gives me also Persons which have one of the both addresse!

And which i forgott to say, the restriction on Address should not be on id, it should be on properties of Address.

So basically these 2 specific addresses are specific because of say their street(String) and their streetNo(int) rather then their id.


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.