About 9 months ago, I had asked this question and got no feedback, so I thought I would try again. I've gotten away without having to do this, but if I could, it would be a huge help.
I have 3 tables, A,B and C. A is one to many with B, and B is one to many with C. These relationships are easy to map out. I thought the relationship I wanted was easy as well, but it appears not.
I want to have a property on A (say getCs()) that is mapped to all the Cs whose Bs are mapped to this A. For example:
Code:
A1 -- B11 -- C111
| \- C112
\- B12 -- C121
\- C122
A2 -- B21 -- C211
| \- C212
\- B22 -- C221
\- C222
A1.getCs() would return [C111, C112, C121, C122] and A2.getCs() would return [C211, C212, C221, C222].
Can anyone tell me how to do this, either with hibernate annotations, or with a mapping xml file, either case will be fine. I also do not care if the C objs have a getA() method.
Thank you!
DS