Hello Everybody,
I have the following DB schema (A,B,C,D and E are tables, the - sign shows association):
A-B-C
B-D
B-E
A-B is one-to-many
B-C is one-to-one
B-D is one-to-one
B-E is one-to-one
C, D and E are inherited from B.
ex:
<class name="B">
<many-to-one name="ownerA" class="A">
<column name="a_id" not-null="true" />
</many-to-one>
...
</class>
<joined-subclass name="C" extends="B">
<key column="b_id"/>
...
</joined-subclass>
In A I want to have collections of C D E seperatelly.
So I want to use:
<set name="collC">
<key column="a_id">
<one-to-many class="C" />
</set>
The problem is that tables C D and E do not have a column a_id. They are connected to table B by b_id column, and table B is connected with table A by a_id column.
Whan hib tries to initialize collC it claims that table C does not have column a_id.
DO you have any idea how to solve the problem ?
Many Thanks
Karol
|