Your mapping:
Code:
<class name="ParentChild.Parent, ParentChild" table="Parents">
<id name="Id" column="Id" type="Int32" length="4" unsaved-value="-1">
<generator class="identity" />
</id>
<bag name="Children" lazy="true" inverse="true" cascade="all">
<key column="Id" />
<one-to-many class="ParentChild.Child, ParentChild"/>
</bag>
</class>
<class name="ParentChild.Child, ParentChild" table="Children">
<id name="Id" column="Id" type="Int32" length="4" unsaved-value="-1">
<generator class="identity" />
</id>
<many-to-one class="ParentChild.Parent, ParentChild" column="ParentId"/>
</class>
I think the "key" element of the bag should be mapped as
Code:
<key column="ParentId">