views:

24

answers:

0

What's wrong with this mapping? On saving an instance of Class3, two rows in Table_2 will be inserted!

first row has Column4 set to null and correct value of Column3, and second row has Column3 set to null and correct value of Column4!

  <class name="Class1" table="Table_1">
    <id name="Column1">
      <generator class="native" />
    </id>
    <discriminator column="ColumnDisc" />
    <property name="Column2" type="int" />
        <subclass name="Class2">
          <join table="Table_2">
            <key column="Column1" />
            <property name="Column3" type="int" />
          </join>
          <subclass name="Class3" >
            <join table="Table_2">
              <key column="Column1" />
              <property name="Column4" type="int" />
            </join>
          </subclass>
        </subclass>
      </class>

thanks in advance guys :-)