-->
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 restricted by the properties of a many-to-one set?
PostPosted: Fri Aug 11, 2006 10:11 am 
Newbie

Joined: Tue Jun 27, 2006 11:01 pm
Posts: 4
Hi all,

I have an Object A which uses hibernate for persistence, which contains a Set of another Object B as a property (typical many to one hibernate mapping). What I need to do is get all of the A objects where a property of one or more of its B objects is a String value. The SQL to return what I want would be similar to this:

Code:
SELECT DISTINCT A.* FROM A,B WHERE B.A_ID = A.ID AND B.COMPLETE='f';


However, I would really rather use either a Criteria object, or HQL to accomplish this task. Can anybody offer any advice on how I might accomplish this?

Thanks much in advance

Ben.


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.