Hi all,
I have a question about mapping a many-to-many association using list. Suppose I have a schema like that :
Customer {id : int}
Account {id : int}
Customer_Account {CustomerID : int, AccountID : int, CustomerIndex : int, AccountIndex : int}
now I mapped the association using list :
In Customer mapping:
Code:
<list name="accounts" table="Customer_Account" cascade="save-update,lock">
<key column="AccountID" not-null="true"/>
<list-index column="AccountIndex"/>
<many-to-many column="CustomerID" class="Customer"/>
</list>
In Account mapping:
Code:
<list name="customers" table="Customer_Account" cascade="save-update,lock">
<key column="CustomerID" not-null="true"/>
<list-index column="CustomerIndex"/>
<many-to-many column="AccountID" class="Account"/>
</list>
When I saving the customer object, it only insert the CustomerID, CustomerIndex and AccountID into the database, did anyone know whats wrong with it?[/code]