Joined: Thu Nov 16, 2006 10:01 am Posts: 5
|
Hi,
I have a table which has more than two one-to-one relationships with other tables. I am using foreign generator class to generate the ids for the persistent objects. But if I use the property param more than one time I got an error. What can I do?
The code:
Customer.hbm.xml
<class name="Customer" table="Customer">
<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="foreign">
<param name="property">Shop</param>
<param name="property">Market </param>
</generator>
</id>
<one-to-one name ="CustomerId" class="Shop" constrained="true"/>
<one-to-one name ="CustomerId" class="Market" constrained="true" />
Shop.hbm.xml:
<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="assigned"/>
</id>
<one-to-one name="CustomerId" class="Customer"/>
Market.hbm.xml:
<id name="CustomerId" column="CustomerID" type="Int32" unsaved-value="0">
<generator class="assigned"/>
</id>
<one-to-one name="CustomerId" class="Customer"/>
|
|