I have mapping:
<class name="User" table="Users" lazy="false">
<id name="id" type="Int32" column="id">
<generator class="identity" />
</id>
<property name="name" column="name" type="String"/>
<map name="Urls" table="UserUrl" lazy="true" inverse="true" cascade="all">
<key column="user_id"></key>
<index column="url_type_id" type="Int32"/>
<one-to-many class="UserUrl"/>
</map>
</class>
<class name="UserUrl" table="UserUrl" lazy="false">
<id name="id" type="Int32" column="id">
<generator class="identity"/>
</id>
<property name="user_id" column="user_id" type="Int32" not-null="true"/>
<property name="UrlType" column="url_type_id" type="Int32" not-null="true"/>
<property name="Url" column="url" type="String" not-null="true"/>
</class>
Also I get
class User
{
IDictionary<int,UserUrl> Urls;
....
}
User currentUser = FindById(2);
currentUser.Urls.Remove(5);
So I remove one item from assosiation collection of Url. Then I call SaveOrUpdateCopy(...)
, But url from table UserUrl
doesn't delete and there is no error.
Does anybody know how to delete child item from collection and from DB?