From 0b04430fdd60251b1c15f56b9ac375e0005ca4d7 Mon Sep 17 00:00:00 2001 From: shen dongsheng Date: Tue, 7 Nov 2017 11:11:38 +0800 Subject: [PATCH] HHH-12082 - Fix some errors and formatting issues in the User Guide --- .../userguide/chapters/domain/collections.adoc | 2 +- .../userguide/chapters/jdbc/Database_Access.adoc | 2 +- .../userguide/chapters/pc/PersistenceContext.adoc | 2 +- .../chapters/transactions/Transactions.adoc | 15 ++++++++++----- .../userguide/pc/PersistenceContextTest.java | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc index 2ef044550b..e78cd070b5 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/domain/collections.adoc @@ -626,7 +626,7 @@ include::{sourcedir}/type/TimestampEpochType.java[tags=collections-map-custom-ke ---- The `TimestampEpochType` allows us to map a Unix timestamp since epoch to a `java.util.Date`. -But, without the `@MapKeyType` Hibernate annotation, it would nt be possible to customize the `Map` key type. +But, without the `@MapKeyType` Hibernate annotation, it would not be possible to customize the `Map` key type. [[collections-map-key-class]] ===== Maps having an interface type as the key diff --git a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc index bf59227ca6..63c803d51b 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/jdbc/Database_Access.adoc @@ -121,7 +121,7 @@ Note that Hikari only supports JDBC standard isolation levels (apparently). [IMPORTANT] ==== -The built-in connection pool is not supported supported for use. +The built-in connection pool is not supported for use in a production system. ==== This section is here just for completeness. diff --git a/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc b/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc index 72e15064aa..9a934b33f2 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/pc/PersistenceContext.adoc @@ -326,7 +326,7 @@ include::{extrasdir}/pc-managed-state-dynamic-update-example.sql[] ---- ==== -The dynamic update allows you to set just the columns sthat were modified in the associated entity. +The dynamic update allows you to set just the columns that were modified in the associated entity. [[pc-refresh]] === Refresh entity state diff --git a/documentation/src/main/asciidoc/userguide/chapters/transactions/Transactions.adoc b/documentation/src/main/asciidoc/userguide/chapters/transactions/Transactions.adoc index 33e5b15189..d64eeea10e 100644 --- a/documentation/src/main/asciidoc/userguide/chapters/transactions/Transactions.adoc +++ b/documentation/src/main/asciidoc/userguide/chapters/transactions/Transactions.adoc @@ -162,11 +162,16 @@ See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hi It defines a single method, `currentSession()`, by which the implementation is responsible for tracking the current contextual session. Out-of-the-box, Hibernate comes with three implementations of this interface: -`org.hibernate.context.internal.JTASessionContext`:: current sessions are tracked and scoped by a `JTA` transaction. -The processing here is exactly the same as in the older JTA-only approach. See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/JTASessionContext.html[Javadocs] for more details. -* `org.hibernate.context.internal.ThreadLocalSessionContext`:current sessions are tracked by thread of execution. See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/ThreadLocalSessionContext.html[Javadocs] for more details. -* `org.hibernate.context.internal.ManagedSessionContext`: current sessions are tracked by thread of execution. -However, you are responsible to bind and unbind a `Session` instance with static methods on this class: it does not open, flush, or close a `Session`. See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/ManagedSessionContext.html[Javadocs] for details. +`org.hibernate.context.internal.JTASessionContext`:: +current sessions are tracked and scoped by a `JTA` transaction. +The processing here is exactly the same as in the older JTA-only approach. +See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/JTASessionContext.html[Javadocs] for more details. +`org.hibernate.context.internal.ThreadLocalSessionContext`:: +current sessions are tracked by thread of execution. See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/ThreadLocalSessionContext.html[Javadocs] for more details. +`org.hibernate.context.internal.ManagedSessionContext`:: +current sessions are tracked by thread of execution. +However, you are responsible to bind and unbind a `Session` instance with static methods on this class; it does not open, flush, or close a `Session`. +See the https://docs.jboss.org/hibernate/orm/{majorMinorVersion}/javadocs/org/hibernate/context/internal/ManagedSessionContext.html[Javadocs] for details. Typically, the value of this parameter would just name the implementation class to use. For the three out-of-the-box implementations, however, there are three corresponding short names: _jta_, _thread_, and _managed_. diff --git a/documentation/src/test/java/org/hibernate/userguide/pc/PersistenceContextTest.java b/documentation/src/test/java/org/hibernate/userguide/pc/PersistenceContextTest.java index fa566a6c50..87d7c75254 100644 --- a/documentation/src/test/java/org/hibernate/userguide/pc/PersistenceContextTest.java +++ b/documentation/src/test/java/org/hibernate/userguide/pc/PersistenceContextTest.java @@ -223,7 +223,7 @@ public class PersistenceContextTest extends BaseEntityManagerFunctionalTestCase //tag::pc-managed-state-native-example[] Person person = session.byId( Person.class ).load( personId ); person.setName("John Doe"); - entityManager.flush(); + session.flush(); //end::pc-managed-state-native-example[] } );