Move explanation to better place

git-svn-id: https://svn.jboss.org/repos/hibernate/trunk/Hibernate3/doc@7939 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Christian Bauer 2005-08-17 19:19:02 +00:00
parent 1a0b7ee25c
commit 8e2ae9efa2
2 changed files with 24 additions and 22 deletions

View File

@ -2075,7 +2075,7 @@
</sect2>
<sect2 id="mapping-declaration-subclass" revision="3">
<sect2 id="mapping-declaration-subclass" revision="4">
<title>subclass</title>
<para>
@ -2099,7 +2099,8 @@
dynamic-update="true|false"
dynamic-insert="true|false"
entity-name="EntityName"
node="element-name">
node="element-name"
extends="SuperclassName">
<property .... />
.....
@ -2139,24 +2140,6 @@
fully qualified Java class name is used.
</para>
<para>
It is possible to define <literal>subclass</literal>, <literal>union-subclass</literal>,
and <literal>joined-subclass</literal> mappings in separate mapping documents, directly beneath
<literal>hibernate-mapping</literal>. This allows you to extend a class hierachy just by adding
a new mapping file. You must specify an <literal>extends</literal> attribute in the subclass mapping,
naming a previously mapped superclass. Note: Previously this feature made the ordering of the mapping
documents important. Since Hibernate3, the ordering of mapping files does not matter when using the
extends keyword. The ordering inside a single mapping file still needs to be defined as superclasses
before subclasses.
</para>
<programlisting><![CDATA[
<hibernate-mapping>
<subclass name="DomesticCat" extends="Cat" discriminator-value="D">
<property name="name" type="string"/>
</subclass>
</hibernate-mapping>]]></programlisting>
<para>
For information about inheritance mappings, see <xref linkend="inheritance"/>.
</para>

View File

@ -1,7 +1,7 @@
<chapter id="inheritance">
<title>Inheritance Mapping</title>
<sect1 id="inheritance-strategies" revision="2">
<sect1 id="inheritance-strategies" revision="3">
<title>The Three Strategies</title>
<para>
@ -52,7 +52,26 @@
<literal>&lt;subclass&gt;</literal> and <literal>&lt;join&gt;</literal>
elements (see below).
</para>
<para>
It is possible to define <literal>subclass</literal>, <literal>union-subclass</literal>,
and <literal>joined-subclass</literal> mappings in separate mapping documents, directly beneath
<literal>hibernate-mapping</literal>. This allows you to extend a class hierachy just by adding
a new mapping file. You must specify an <literal>extends</literal> attribute in the subclass mapping,
naming a previously mapped superclass. Note: Previously this feature made the ordering of the mapping
documents important. Since Hibernate3, the ordering of mapping files does not matter when using the
extends keyword. The ordering inside a single mapping file still needs to be defined as superclasses
before subclasses.
</para>
<programlisting><![CDATA[
<hibernate-mapping>
<subclass name="DomesticCat" extends="Cat" discriminator-value="D">
<property name="name" type="string"/>
</subclass>
</hibernate-mapping>]]></programlisting>
<sect2 id="inheritance-tableperclass" >
<title>Table per class hierarchy</title>