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.