Hibernate 3
Oracle 9i
I work with a legacy database. In a table I have the key of two others
tables, Account and Treaty.
The key of Account is no_cie. A treaty is associated to an Account and
its key contains the Account key also, then no_cie and no_treaty is its
key.
Then in the table I have to map, no_cie and no_treaty exist.
Sometimes no_cie and no_treaty are both filled then I have a treaty,
but sometimes only the no_cie is filled then I only have an Account.
So far with many-to-one property I load both of then if I have
a Treaty and only the Account if no_treaty is null.
Here's the code
Quote:
<many-to-one name="treaty" class="Treaty" >
<column name="NO_CIE" />
<column name="NO_TRAITE" />
</many-to-one>
<many-to-one name="account" class="Account" >
<column name="NO_CIE" />
</many-to-one>
I would like, to be able to load an Account or a Treaty but
not both.
Any ideas??