Hi,
I have two tables I'm trying to map such that it forms a one-to-many (parent-child) relationship. The problem is that the foreign-key in the CHILDTABLE is not the primary-key of the PARENTTABLE. How would I map such a relationship? I'm trying to do this as follows (using property-ref instead of identifying the column directly), but it doesn't work.
The following is the relevant portion of the child POJO.
Code:
<many-to-one name="parent"
class="edu.nyu.tutorial.Parent"
property-ref="childId"
insert="false" update="false" unique="false"
optimistic-lock="true" not-found="exception" embed-xml="true"/>
Again, in the child POJO the PK is the "childId" but it is also supposed to be the FK. However, it is not the PK of the parent.
Any guidance as to what is wrong with the above would be helpful. thanks!