-->
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: Criteria with one to many relationship
PostPosted: Thu Jan 20, 2011 7:07 pm 
Newbie

Joined: Thu Jan 20, 2011 4:52 pm
Posts: 2
Hi Java friends.

I have this particular problem, maybe you can help me.

I have an entity Person and one person can have many kids.

What i try to do is, when i receive one kid, i try to find her mother.

So its like this

Criteria.add(Restrictions.eq("Kids", kid))

But i think they are matching this kid with the collection (Set) of Kids, and i got an error.

I dont know how to solve this, i want to compare that kid with all of Person`s kid, and if find one equal return to me.

Well, i apreciate any help. THXX


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.