Hi guys, I have some problem when joining 2 tables. In the xml below, I used property-ref to join 2 different tables, however when I save FooObject in hibernate, it insert the id of FooObj instead of referenceId to the column TBL_B_REF_ID of TBL_B. Does anyone know how to fix this problem? Thx.
Code:
<class name="FooObj" table="TBL_A">
<id name="id" column="TBL_A_ID">
<generator class="sequence">
<param name="sequence">SEQ_TBL_A_KEY</param>
</generator>
</id>
<property name="referenceId" column="TBL_A_REF_ID" />
<join table="TBL_B">
<key column="TBL_B_REF_ID" on-delete="cascade" property-ref="referenceId" />
<property name="foo1" column="TBL_B_COL_1" />
<property name="foo2" column="TBL_B_COL_1" />
</join>
</class>