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: Using criteria query with collection properties
PostPosted: Tue Aug 28, 2007 12:15 pm 
Newbie

Joined: Fri Feb 16, 2007 6:52 am
Posts: 5
Is there a way to add restrictions over an collection properties?
something like :
Restriction.eq("encounter.partecipation[0].name","ale");

thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 29, 2007 4:44 am 
Regular
Regular

Joined: Thu Oct 19, 2006 12:07 pm
Posts: 75
Yes, something like this :

Code:
Criteria c = getSession().createCriteria(Encounter.class, "encounter");

c.createCriteria("partecipation").add(Restrictions.eq("name","ale"));


Hope this is what you wanted. This will return all "encounter" objects, that have a "partecipation" that has a "name" of "ale".


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.