There could have an answer to this question in the archive, I may not have
put in the right search string to find it. Would appreciate if anyone
could point me to one if he/she knows its existence.

My simple question on Join Table:

How do I join two or more tables with Foreign Key(s) pointing to a common
Table?

            Criteria criteria = new Criteria();
            criteria.addJoin(TABLE_B.Ref_A_ID, TABLE_A.ID);
            criteria.addJoin(TABLE_A.ID, TABLE_C.Ref_A_ID);
            return (TABLE_C.doSelect(criteria));

did not work.

e.g.  Table_B and Table_C have foreign-keys (Ref_A_ID) referencing to ID
in Table_A.

Table A
ID
Col_A1
Col_A2

Table B
ID
Ref_A_ID
Col_B1

Table C
ID
Ref_A_ID
Col_C1

Thanks
michael






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to