kjc5667 wrote:
Hibernate version: 3.05
I have a mapping question that I have not been able to find an example for.
I have a class A, which is composed of composite instances of class B, and C.
Likewiae, class B, and C, are composed of composite class instances of class D, and E.
My question is. How do I map this relationship so that ALL primary keys are the same, and all respective fields for all classes are persisted into individual tables, and when loading,deleting,updating class A,
that instances of classes B,C,D and E respectively.
I have the answer to the last part, use the cascade="all" attribute.
It's the primary key aspect of this problem that has me confused.
Thanks in advance.
I think that you can use the
Code:
<generator class="foreign">
// I do not know what params go here
</generator>
and specify the Pk for A in B and C and so on.