I am trying to create a mapping file for a 1-* that has a linking/association table. The only way to do this seems to be with a many-to-many. So the mapping looks like this:
Code:
<class name="OrderData" table="OrdOrder">
<composite-id name="ID" class="InstanceID">
<key-property name="ID" column ="OrderId" type ="Int32"/>
</composite-id>
<property name="ClientID" column="CustomerId" type="Int32" />
<set name="Loans" table="OrdOrderLoan" >
<key column="OrderId"/>
<many-to-many column="LoanId" class="Loan"/>
</set>
</class>
The problem I have is with the collection. It is always empty even though I profile the sql and I see the child records retrieved. So I have two questions:
1. Is the mapping file correct?
2. Why don't the child entities get put into the collection?
Thanks,