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 API
PostPosted: Sat Aug 23, 2008 7:13 am 
Newbie

Joined: Sat Sep 22, 2007 1:48 am
Posts: 4
Hi

I have class A having a set of Class B.
Class B have id,prop and another Class C mapped as many-to-one
Class C have id,name among others.

Now I want to construct a Criteria or Query preferably a Criteria
to fetch me all the A's whose B's must have b.prop=100 and b.c.id=2 and b.prop=200 and b.c.id=3. I have put the emphasis on the and because I need only those A's who's B satisfy both condition ie if a B of an A satisfy one condtion another B of the same A should satisfy the other condtion.

In simple word the query is

Fetch all A's whose Bs must have a B which satisfy prop=200 and cid=3 and another B which satisfy prop=100 and cid=2

Thanks


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.