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"><many-to-one
name="person"
+ <programlisting role="XML"><many-to-one
name="owner"
class="Person" property-ref="name">
<column name="firstName"/>
<column name="initial"/>
<column name="lastName"/>
</many-to-one></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><import
- class="ClassName"
- rename="ShortName"
-/></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>
+@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">
Show replies by date