Hi,

We have modeled the relationship between domain objects using the
table per subclass hierarchy structure.

The structure looks like:

Parent:

<?xml version="1.0" encoding="iso-8859-1"?>
<hibernate-mapping default-lazy="false" default-cascade="none"
xmlns="urn:nhibernate-mapping-2.2" >
  <class name="ParentDO, TestProject1" table="TBLX" dynamic-insert
="false" dynamic-update="false">
<id name="ID" column="IDCol" type="System.Int64" unsaved-value="null">
      <generator class="sequence">
        <param name="sequence">SEQ01T</param>
      </generator>
    </id>
    <version name="ver" column="ROWID" type="Int32" generated="never"
unsaved-value="null" />
    <property name="Xid" column="XID" type="System.Int64"
insert="true" update="true" />
    <property name="RowID" column="ROWID" type="System.String"
insert="false" update="false" />
  </class>
</hibernate-mapping>

The relationship has been mapped as follows:

<?xml version="1.0" encoding="iso-8859-1"?>
<hibernate-mapping default-lazy="false" default-cascade="none"
xmlns="urn:nhibernate-mapping-2.2">
<joined-subclass name="Child, TestProject1" extends="ParentDO,
TestProject1" table="TBLY" >
<key column="CHILDID" foreign-key="PARENTID"/>
<property..../>
<property..../>
</joined-subclass>
</hibernate-mapping>

The delete cascade works as desired, however whenever we delete the
subclass the delete happens not only on the table to which the
subclass has been mapped, but also the root table and potentially
joined-subclass tables further down the inheritance hierarchy.

We have tried setting the dynamic-update and dynamic-insert properties
to false and also tried to set the cascade property to save-update,
none... The delete still moves up to the parent table.

Is this a known issue, or are we missing something.

Please help.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.

Reply via email to