-->
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: DetachedCriteriaQuery on Collection
PostPosted: Tue Sep 12, 2006 2:58 am 
Newbie

Joined: Tue Sep 12, 2006 2:41 am
Posts: 5
Hi,
I want to create a DetachedCriteria query using Hibernate3.1
the query is on collection of obects.
For eg

Search for A where childrens B are b1 and b2;

DetachedCriteria EmpCriteria = DeptCriteria.createCriteria("EmpCollection");
EmpCriteria.add(Restrictions.gt("age",new Float("50")));
DetachedCriteria ManagerCrit = EmpCriteria.createCriteria("manager");
ManagerCrit.add(Restrictions.eq("name","XYZ"));

Above condition is on one object of collection similarly i want to more such conditions such as

EmpCriteria.add(Restrictions.gt("age",new Float("30")));
DetachedCriteria ManagerCrit = EmpCriteria.createCriteria("manager");
ManagerCrit.add(Restrictions.eq("name","ABC"));

Is there any way to for DetachedCriteria which satisfies the query on collection such as Give Dept which is associated with Empl
(age>30 and which is associated with Manager(name='XYZ')) AND
(age>50 and which is associated with Manager(name='ABC')) ?

~Sachin


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.