Hi,
I have a product that has 1 or more product relations.
Entities: Product and ProductRelation
So product has a property List(Of ProductRelation)
Now I have a checkboxlist where I can select a number of products that I want to assign to this product.
When I add a new collection of ProductRelations with the new products, It should delete all old relations and save the new one. But this does not work. It does not delete the old one and also not saves the new one.
I have used the following hbm.xml
<bag name="RelatedProduct" inverse="true" lazy="true" cascade="all">
<key column="FromID" />
<one-to-many class="Kiwa.Objects.RelatedProduct,Kiwa.Objects" />
</bag>