[hibernate-commits] Hibernate SVN: r19617 - core/trunk/documentation/manual/src/main/docbook/en-US/content.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed May 26 12:19:35 EDT 2010


Author: epbernard
Date: 2010-05-26 12:19:35 -0400 (Wed, 26 May 2010)
New Revision: 19617

Modified:
   core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
Log:
HHH-5149 Merge <properties> section with annotations own construct

Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
===================================================================
--- core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml	2010-05-26 16:19:02 UTC (rev 19616)
+++ core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml	2010-05-26 16:19:35 UTC (rev 19617)
@@ -4739,35 +4739,41 @@
       unique key of the <literal>Person</literal> table, instead of to the
       primary key:</para>
 
-      <programlisting role="XML">&lt;many-to-one name="person"
+      <programlisting role="XML">&lt;many-to-one name="owner"
          class="Person" property-ref="name"&gt;
     &lt;column name="firstName"/&gt;
     &lt;column name="initial"/&gt;
     &lt;column name="lastName"/&gt;
 &lt;/many-to-one&gt;</programlisting>
 
-      <para>The use of this outside the context of mapping legacy data is not
-      recommended.</para>
-    </section>
+      <note>
+        <para>When using annotations as a mapping strategy, such construct is
+        not necessary as the binding between a column and its related column
+        on the associated table is done directly</para>
 
-        <programlisting>&lt;import
-        class="ClassName"
-        rename="ShortName"
-/&gt;</programlisting>
+        <programlisting>@Entity
+class Person {
+   @Id Integer personNumber;
+   String firstName;
+   @Column(name="I")
+   String initial;
+   String lastName;
+}
 
-        <calloutlist>
-          <callout arearefs="import1">
-            <para><literal>class</literal>: the fully qualified class name of
-            any Java class.</para>
-          </callout>
+ at Entity
+class Home {
+   @ManyToOne
+   @JoinColumns({
+      @JoinColumn(name="first_name", referencedColumnName="firstName"),
+      @JoinColumn(name="init", referencedColumnName="I"),
+      @JoinColumn(name="last_name", referencedColumnName="lastName"),
+   })
+   Person owner
+}</programlisting>
+      </note>
 
-          <callout arearefs="import2">
-            <para><literal>rename</literal> (optional - defaults to the
-            unqualified class name): a name that can be used in the query
-            language.</para>
-          </callout>
-        </calloutlist>
-      </programlistingco>
+      <para>The use of this outside the context of mapping legacy data is not
+      recommended.</para>
     </section>
 
     <section id="mapping-types-anymapping" revision="2">



More information about the hibernate-commits mailing list