Hi,
I've got a problem with a nested table architecture.
Table1:
Code:
<class name="Header" table="header">
<id name="DlvyNo" column="dlvy_no" type="java.lang.Integer"/>
<property name="BpCd" column="bp_cd" type="java.lang.String" />
<property name="BpOdsCd" column="bp_ods_cd" type="java.lang.String" />
<property name="CustNb" column="cust_nb" type="java.lang.String" />
<set name="lines" lazy="false" fetch="subselect" cascade="none" >
<key column="dlvy_no" />
<one-to-many class="Line"/>
</set>
</class>
Table2:
Code:
<class name="Line" table="line">
<composite-id>
<key-property name="DlvyLiNo" column="dlvy_li_no" type="java.lang.Integer"/>
<key-property name="DlvyNo" column="dlvy_no" type="java.lang.Integer"/>
</composite-id>
<property name="CatItCd" column="cat_it_cd" type="java.lang.String" />
</class>
Now I want to map a third table on the Line table as a one-to-one relation. But this table hast a composite key which contains columns from table1 AND table2.
Table3:
Code:
<class name="Stock" table="stock">
<composite-id>
<key-property name="BpCd" column="bp_cd" type="java.lang.String"/>
<key-property name="BpOdsCd" column="bp_ods_cd" type="java.lang.String" />
<key-property name="CatItCd" column="cat_it_cd" type="java.lang.String" />
<key-property name="CustNb" column="cust_nb" type="java.lang.String" />
<key-property name="VersCd" column="vers_cd" type="java.lang.String" />
</composite-id>
</class>
Unfortunately I have to use these tables and cannot arrange them. Any ideas how it is possible to map this third table?