Hi all,
this is probably easy but I can't work it out. I have the following mapping:
Code:
<class name="Company" table="Customers">
<id column="CompanyID" name="id"/>
<set name="environments" sort="unsorted" table="CustomerEnvironments" lazy="false" batch-size="3">
<key column="CustomerID" not-null="true"/>
<one-to-many class="Environment"/>
</set>
</class>
<class name="Environment" table="CustomerEnvironments">
<id column="ID" type="long" name="id" access="field">
<generator class="identity"/>
</id>
<property column="Environment" name="name" access="field"/>
</class>
I first retrieve a company and it contains 3 environments. I then add 2 new environments and remove all 3 old environments.
After a session.update(company) and a commit, the new environments are added to the database, but those I had removed are still present in my database table.
Do I miss a mapping setting or something here?
Thanks,
Steven