Hi,
I have 3 tables A, B and C, where each C record references
exactly one A and one B. Given a list of B IDs, I would like to
get all the A objects for which its exists at least one C which
references both that A and one of the given B IDs.
For instance, given the following database:
Code:
A1 A2 A3
B1 B2 B3
C1(A1,B1) C2(A2,B2), C3(A3,B1)
# note C3 references B1
if I have the ID list is just "B1", I'd like to get the A objects
A1 and A3 (because both C1 and C3 refer to B1, and in turn they
refer to A1 and A3.)
Is it possible with Criterion objects, or with HQL?
Regards,
--
Florent Georges
http://www.fgeorges.org/