Hello,
I used Hibernate tools to map a table from a legacy database. My problem is that the primary key (ao) is also a foreign key, and I don't know how to show this in the xml. This is what I have right now:
Code:
<hibernate-mapping>
<class name="RepeatCallerAo" table="REPEAT_CALLER_AO" lazy="false">
<id name="ao" type="string">
<column name="AO" length="50" />
<generator class="assigned" />
</id>
<many-to-one name="aoByRelatedAo2" class="Ao" fetch="select">
<column name="RELATED_AO_2" length="50" />
</many-to-one>
<many-to-one name="aoByRelatedAo1" class="Ao" fetch="select">
<column name="RELATED_AO_1" length="50" />
</many-to-one>
<property name="repeatLogicInd" type="string">
<column name="REPEAT_LOGIC_IND" length="1" not-null="true" />
</property>
</class>
</hibernate-mapping>
the next two columns (aoByRelatedAo2 and aoByRelatedAo1) have the same relationship with the same table as the primary key and show a many to one relationship as expected. Is there a way to do the same with the primary key column?
Thanks in advance for your help!