<p>Currently I have a structure like this:</p>

<pre><code>A
|
+--B
|
+--C
</code></pre>

<p>It's mapped with one table per subclass using joined tables. For historic reasons I also use a discriminator, so the current situation is as described in <a href="http://www.hibernate.org/hib_docs/v3/reference/en-US/html/inheritance.html#inheritance-tablepersubclass-discriminator" rel="noreferrer">Section 9.1.3 of the Hibernate manual</a>.</p>

<p><strong>Question:</strong> How do I extend the mapping for a structure like this:</p>

<pre><code>A
|
+--B
|  |
|  D
|
+--C
</code></pre>

<p>Can I <code>&lt;subclass&gt;</code> a <code>&lt;subclass&gt;</code> in the hibernate mapping? What <code>&lt;key&gt;</code>s do I need?</p>

not tested
but, according to the link you posted if you are using hibernate3
```
```
<hibernate-mapping>
  <class name="A" table="A">
    <id name="id" type="long" column="a_id">
      <generator class="native"/>
    </id>
    <discriminator column="discriminator_col" type="string"/>
    <property name="" type=""/>
    <!-- ... -->
  </class>
  <subclass name="B" extends="A" discriminator-value="B">
    <!-- ... -->
  </subclass>
  <subclass name="D" extends="B" discriminator-value="D">
    <!-- ... -->
  </subclass>
  <subclass name="C" extends="A" discriminator-value="C">
    <!-- ... -->
  </subclass>
</hibernate-mapping>
```
```