Fixed typos in Chapter 5. Basic O/R Mapping

Fixed typo in Chapter 5 - 5.1.1 Entity.

Fixed key-property column name.

Added missing parameters in set methods.

Fixed typos.

Fix typo

Removed wrong whitespace.

Fixed section associations to many to one as used in the section.

Removed wrong whitespace.

Fix typo

Removed 'with' duplication.
This commit is contained in:
Belev 2015-05-21 17:41:57 +03:00 committed by Brett Meyer
parent 4309d518e9
commit 5c8d1ac500
2 changed files with 15 additions and 15 deletions

View File

@ -245,7 +245,7 @@ public class Flight implements Serializable {
</tip>
<para><literal>@Entity.name</literal> lets you define the shortcut name
of the entity you can used in JP-QL and HQL queries. It defaults to the
of the entity you can use in JP-QL and HQL queries. It defaults to the
unqualified class name of the class.</para>
<para>Hibernate goes beyond the JPA specification and provide additional
@ -938,7 +938,7 @@ class UserId implements Serializable {
<programlisting role="XML">&lt;class name="Customer"&gt;
&lt;composite-id name="id" class="CustomerId"&gt;
&lt;key-property name="firstName" column="userfirstname_fk"/&gt;
&lt;key-property name="lastName" column="userfirstname_fk"/&gt;
&lt;key-property name="lastName" column="userlastname_fk"/&gt;
&lt;key-property name="customerNumber"/&gt;
&lt;/composite-id&gt;
@ -1081,7 +1081,7 @@ class UserId implements Serializable {
</section>
<section>
<title>Multiple id properties with with a dedicated identifier
<title>Multiple id properties with a dedicated identifier
type</title>
<para><classname>@IdClass</classname> on an entity points to the
@ -2600,7 +2600,7 @@ public class Order {
@Embedded private Address address;
public Address getAddress() { return address; }
public void setAddress() { this.address = address; }
public void setAddress(Address address) { this.address = address; }
}
@Entity
@ -2611,7 +2611,7 @@ public class User {
private Address address;
@Embedded public Address getAddress() { return address; }
public void setAddress() { this.address = address; }
public void setAddress(Address address) { this.address = address; }
}
@Embeddable
@ -2619,7 +2619,7 @@ public class User {
public class Address {
private String street1;
public String getStreet1() { return street1; }
public void setStreet1() { this.street1 = street1; }
public void setStreet1(String street1) { this.street1 = street1; }
private hashCode; //not persistent
}</programlisting>
@ -2637,7 +2637,7 @@ public class Order {
@Access(AccessType.PROPERTY)
public String getOrderNumber() { return userId + ":" + orderId; }
public void setOrderNumber() { this.userId = ...; this.orderId = ...; }
public void setOrderNumber(String userId, String orderId) { this.userId = userId; this.orderId = orderId; }
}</programlisting>
<para>In this example, the default access type is
@ -3136,10 +3136,10 @@ public class Country implements Serializable {
Address homeAddress;</programlisting>
<para>Hibernate Annotations supports something that is not explicitly
supported by the JPA specification. You can annotate a embedded object
supported by the JPA specification. You can annotate an embedded object
with the <literal>@MappedSuperclass</literal> annotation to make the
superclass properties persistent (see
<literal>@MappedSuperclass</literal> for more informations).</para>
<literal>@MappedSuperclass</literal> for more information).</para>
<para>You can also use association annotations in an embeddable object
(ie <literal>@OneToOne</literal>, <classname>@ManyToOne</classname>,
@ -3857,7 +3857,7 @@ public class Plane extends FlyingObject {
<title>Mapping one entity to several tables</title>
<para>While not recommended for a fresh schema, some legacy databases
force your to map a single entity on several tables.</para>
force you to map a single entity on several tables.</para>
<para>Using the <literal>@SecondaryTable</literal> or
<literal>@SecondaryTables</literal> class level annotations. To
@ -4088,7 +4088,7 @@ public class Cat implements Serializable {
</section>
<section>
<title>Mapping one to one and one to many associations</title>
<title>Mapping one to one and many to one associations</title>
<para>To link one entity to another, you need to map the association
property as a to one association. In the relational model, you can
@ -5874,7 +5874,7 @@ class CreditCard {
to define either of these rules.</para>
</note>
<para>If a property uses more that one column, you must use the
<para>If a property uses more than one column, you must use the
<literal>forColumn</literal> attribute to specify which column, the
expressions are targeting.</para>

View File

@ -131,7 +131,7 @@ private float weight;
<note>
<para>
Historically this was considered option. While still not (yet) enforced, this should be considered
a deprecated feature as it will be completely required to provide a identifier property in an
a deprecated feature as it will be completely required to provide an identifier property in an
upcoming release.
</para>
</note>