Skip to content

Commit ccb7050

Browse files
belevbrmeyer
authored andcommitted
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.
1 parent 9c9541f commit ccb7050

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

documentation/src/main/docbook/manual/en-US/content/basic_mapping.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ public class Flight implements Serializable {
239239
</tip>
240240

241241
<para><literal>@Entity.name</literal> lets you define the shortcut name
242-
of the entity you can used in JP-QL and HQL queries. It defaults to the
242+
of the entity you can use in JP-QL and HQL queries. It defaults to the
243243
unqualified class name of the class.</para>
244244

245245
<para>Hibernate goes beyond the JPA specification and provide additional
@@ -932,7 +932,7 @@ class UserId implements Serializable {
932932
<programlisting role="XML">&lt;class name="Customer"&gt;
933933
&lt;composite-id name="id" class="CustomerId"&gt;
934934
&lt;key-property name="firstName" column="userfirstname_fk"/&gt;
935-
&lt;key-property name="lastName" column="userfirstname_fk"/&gt;
935+
&lt;key-property name="lastName" column="userlastname_fk"/&gt;
936936
&lt;key-property name="customerNumber"/&gt;
937937
&lt;/composite-id&gt;
938938

@@ -1075,7 +1075,7 @@ class UserId implements Serializable {
10751075
</section>
10761076

10771077
<section>
1078-
<title>Multiple id properties with with a dedicated identifier
1078+
<title>Multiple id properties with a dedicated identifier
10791079
type</title>
10801080

10811081
<para><classname>@IdClass</classname> on an entity points to the
@@ -2594,7 +2594,7 @@ public class Order {
25942594

25952595
@Embedded private Address address;
25962596
public Address getAddress() { return address; }
2597-
public void setAddress() { this.address = address; }
2597+
public void setAddress(Address address) { this.address = address; }
25982598
}
25992599

26002600
@Entity
@@ -2605,15 +2605,15 @@ public class User {
26052605

26062606
private Address address;
26072607
@Embedded public Address getAddress() { return address; }
2608-
public void setAddress() { this.address = address; }
2608+
public void setAddress(Address address) { this.address = address; }
26092609
}
26102610

26112611
@Embeddable
26122612
@Access(AcessType.PROPERTY)
26132613
public class Address {
26142614
private String street1;
26152615
public String getStreet1() { return street1; }
2616-
public void setStreet1() { this.street1 = street1; }
2616+
public void setStreet1(String street1) { this.street1 = street1; }
26172617

26182618
private hashCode; //not persistent
26192619
}</programlisting>
@@ -2631,7 +2631,7 @@ public class Order {
26312631

26322632
@Access(AccessType.PROPERTY)
26332633
public String getOrderNumber() { return userId + ":" + orderId; }
2634-
public void setOrderNumber() { this.userId = ...; this.orderId = ...; }
2634+
public void setOrderNumber(String userId, String orderId) { this.userId = userId; this.orderId = orderId; }
26352635
}</programlisting>
26362636

26372637
<para>In this example, the default access type is
@@ -3130,10 +3130,10 @@ public class Country implements Serializable {
31303130
Address homeAddress;</programlisting>
31313131

31323132
<para>Hibernate Annotations supports something that is not explicitly
3133-
supported by the JPA specification. You can annotate a embedded object
3133+
supported by the JPA specification. You can annotate an embedded object
31343134
with the <literal>@MappedSuperclass</literal> annotation to make the
31353135
superclass properties persistent (see
3136-
<literal>@MappedSuperclass</literal> for more informations).</para>
3136+
<literal>@MappedSuperclass</literal> for more information).</para>
31373137

31383138
<para>You can also use association annotations in an embeddable object
31393139
(ie <literal>@OneToOne</literal>, <classname>@ManyToOne</classname>,
@@ -3852,7 +3852,7 @@ public class Plane extends FlyingObject {
38523852
<title>Mapping one entity to several tables</title>
38533853

38543854
<para>While not recommended for a fresh schema, some legacy databases
3855-
force your to map a single entity on several tables.</para>
3855+
force you to map a single entity on several tables.</para>
38563856

38573857
<para>Using the <literal>@SecondaryTable</literal> or
38583858
<literal>@SecondaryTables</literal> class level annotations. To
@@ -4083,9 +4083,9 @@ public class Cat implements Serializable {
40834083
</section>
40844084

40854085
<section>
4086-
<title>Mapping one to one and one to many associations</title>
4086+
<title>Mapping one to one and many to one associations</title>
40874087

4088-
<para>To link one entity to an other, you need to map the association
4088+
<para>To link one entity to another, you need to map the association
40894089
property as a to one association. In the relational model, you can
40904090
either use a foreign key or an association table, or (a bit less common)
40914091
share the same primary key value between the two entities.</para>
@@ -4303,7 +4303,7 @@ public class Child {
43034303
alter table Child add constraint FK_PARENT foreign key (parent_id) references Parent</programlisting>
43044304
</example>
43054305

4306-
<para>Sometimes, you want to link one entity to an other not by the
4306+
<para>Sometimes, you want to link one entity to another not by the
43074307
target entity primary key but by a different unique key. You can
43084308
achieve that by referencing the unique key column(s) in
43094309
<methodname>@JoinColumn.referenceColumnName</methodname>.</para>
@@ -5869,7 +5869,7 @@ class CreditCard {
58695869
to define either of these rules.</para>
58705870
</note>
58715871

5872-
<para>If a property uses more that one column, you must use the
5872+
<para>If a property uses more than one column, you must use the
58735873
<literal>forColumn</literal> attribute to specify which column, the
58745874
expressions are targeting.</para>
58755875

documentation/src/main/docbook/manual/en-US/content/persistent_classes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private float weight;
125125
<note>
126126
<para>
127127
Historically this was considered option. While still not (yet) enforced, this should be considered
128-
a deprecated feature as it will be completely required to provide a identifier property in an
128+
a deprecated feature as it will be completely required to provide an identifier property in an
129129
upcoming release.
130130
</para>
131131
</note>

0 commit comments

Comments
 (0)