For some reason my child objects have started cascade deleting their parent objects, rather than just removing themselves from the parent's child collection.
This is obviously a big problem as the child's siblings no longer have a valid parent.
I'm sure I must have just done something silly in my mapping files (see below).
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping
xmlns="urn:nhibernate-mapping-2.0"
assembly="MyAssembly"
namespace="MyNamespace"
default-cascade="all"
default-lazy="true"
>
<class
name="Parent"
dynamic-update="true"
lazy="false"
>
<id name="ID" access="nosetter.lowercase-underscore">
<generator class="assigned" />
</id>
<property name="Name" />
<set name="Children" access="MyAccessor, MyAssembly" inverse="true">
<key column="ParentID" />
<one-to-many class="Child" />
</set>
</class>
<class
name="Child"
dynamic-update="true"
lazy="false"
>
<id name="ID" access="nosetter.lowercase-underscore">
<generator class="assigned" />
</id>
<many-to-one name="Parent" class="Parent" column="ParentID" access="MyAccessor, MyAssembly" not-null="true" />
</class>
</hibernate-mapping>
Nathan