Skip to content

Commit

Permalink
User Guide grammatical corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
vladmihalcea committed Mar 31, 2016
1 parent da5aae7 commit 9570f11
Show file tree
Hide file tree
Showing 37 changed files with 165 additions and 161 deletions.
2 changes: 1 addition & 1 deletion documentation/src/main/asciidoc/userguide/Preface.adoc
Expand Up @@ -38,7 +38,7 @@ hide the power of SQL from you and guarantees that your investment in
relational technology and knowledge is as valid as always.

Hibernate may not be the best solution for data-centric applications
that only use stored-procedures to implement the business logic in the
that only use stored procedures to implement the business logic in the
database, it is most useful with object-oriented domain models and
business logic in the Java-based middle-tier. However, Hibernate can
certainly help you to remove or encapsulate vendor-specific SQL code and
Expand Down
Expand Up @@ -109,7 +109,7 @@ Should generally only configure this or `hibernate.connection.acquisition_mode`,
|`hibernate.c3p0.max_statements` | 5 | Maximum size of C3P0 statement cache. Refers to http://www.mchange.com/projects/c3p0/#maxStatements[c3p0 `maxStatements` setting].
|`hibernate.c3p0.acquire_increment` | 2 | Number of connections acquired at a time when there's no connection available in the pool. Refers to http://www.mchange.com/projects/c3p0/#acquireIncrement[c3p0 `acquireIncrement` setting].
|`hibernate.c3p0.idle_test_period` | 5 | Idle time before a C3P0 pooled connection is validated. Refers to http://www.mchange.com/projects/c3p0/#idleConnectionTestPeriod[c3p0 `idleConnectionTestPeriod` setting].
|`hibernate.c3p0` | | A setting prefix used to indicate additional c3p0 properties that need to be passed ot the underlying c3p0 connection pool.
|`hibernate.c3p0` | | A setting prefix used to indicate additional c3p0 properties that need to be passed to the underlying c3p0 connection pool.
|===================================================================================================================================================================================================================================

[[configurations-mapping]]
Expand Down Expand Up @@ -155,7 +155,7 @@ However, some JPA providers do need the discriminator for handling joined inheri
However, we want to make sure that legacy applications continue to work as well, which puts us in a bind in terms of how to handle _implicit_ discriminator mappings.
The solution is to assume that the absence of discriminator metadata means to follow the legacy behavior _unless_ this setting is enabled.

With this setting enabled, Hibernate will interpret the absence of discriminator metadata as an indication to use the JPA defined defaults for these absent annotations.
With this setting enabled, Hibernate will interpret the absence of discriminator metadata as an indication to use the JPA-defined defaults for these absent annotations.

See Hibernate Jira issue https://hibernate.atlassian.net/browse/HHH-6911[HHH-6911] for additional background info.

Expand All @@ -173,7 +173,7 @@ See Hibernate Jira issue https://hibernate.atlassian.net/browse/HHH-6911[HHH-691
|`hibernate.implicit_naming_strategy` |`default` (default value), `jpa`, `legacy-jpa`, `legacy-hbm`, `component-path` a|

Used to specify the `org.hibernate.boot.model.naming.ImplicitNamingStrategy` class to use.
The following short-names are defined for this setting:
The following short names are defined for this setting:

`default`:: Uses the `org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl`
`jpa`:: Uses the `org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl`
Expand Down Expand Up @@ -272,7 +272,7 @@ The maximum number of entries including:

maintained by `org.hibernate.engine.query.spi.QueryPlanCache`.

|`hibernate.query.plan_parameter_metadata_max_size` | `128` (default value) | The maximum number of strong references associated to `ParameterMetadata` maintained by `org.hibernate.engine.query.spi.QueryPlanCache`.
|`hibernate.query.plan_parameter_metadata_max_size` | `128` (default value) | The maximum number of strong references associated with `ParameterMetadata` maintained by `org.hibernate.engine.query.spi.QueryPlanCache`.
|`hibernate.order_by.default_null_ordering` |`none`, `first` or `last` |Defines precedence of null values in `ORDER BY` clause. Defaults to `none` which varies between RDBMS implementation.
|`hibernate.discriminator.force_in_select` |`true` or `false` (default value) | For entities which do not explicitly say, should we force discriminators into SQL selects?
|`hibernate.query.substitutions` | `true=1,false=0` |A comma-separated list of token substitutions to use when translating a Hibernate query to SQL.
Expand Down Expand Up @@ -371,7 +371,7 @@ In reality, you shouldn't probably enable this setting anyway.

A setting to control whether to `org.hibernate.engine.internal
.StatisticalLoggingSessionEventListener` is enabled on all `Sessions` (unless explicitly disabled for a given `Session`).
The default value of this setting is determined by the value for `hibernate.generate_statistics`, meaning that if collection of statistics is enabled logging of Session metrics is enabled by default too.
The default value of this setting is determined by the value for `hibernate.generate_statistics`, meaning that if statistics are enabled, then logging of Session metrics is enabled by default too.

|===================================================================================================================================================================================================================================

Expand Down Expand Up @@ -507,7 +507,7 @@ In such cases, a value for this setting _must_ be specified.

The value of this setting is expected to match the value returned by `java.sql.DatabaseMetaData#getDatabaseProductName()` for the target database.

Additionally specifying `javax.persistence.database-major-version` and/or `javax.persistence.database-minor-version` may be required to understand exactly how to generate the required schema commands.
Additionally, specifying `javax.persistence.database-major-version` and/or `javax.persistence.database-minor-version` may be required to understand exactly how to generate the required schema commands.

|`javax.persistence.database-major-version` | |

Expand Down
Expand Up @@ -167,7 +167,7 @@ while ( iter.hasNext() ) {
}
----

Additionally you may manipulate the result set using a left outer join:
Additionally, you may manipulate the result set using a left outer join:

[source]
----
Expand Down
Expand Up @@ -44,6 +44,6 @@ The default value of `undefined` indicates that Hibernate uses the identifier pr
Database-based timestamps incur an overhead because Hibernate needs to query the database each time to determine the incremental next value.
However, database-derived timestamps are safer to use in a clustered environment.
Not all database dialects are known to support the retrieval of the database's current timestamp.
Others may also be unsafe for locking, because of lack of precision.
Others may also be unsafe for locking because of lack of precision.
|generated |Whether the timestamp property value is generated by the database. Optional, defaults to `never`.
|=======================================================================
Expand Up @@ -218,7 +218,7 @@ You cannot use stored procedures with Hibernate unless you follow some procedure
If they do not follow those rules they are not usable with Hibernate.
If you still want to use these procedures you have to execute them via `session.doWork()`.

The rules are different for each database, since database vendors have different stored procedure semantics/syntax.
The rules are different for each database since database vendors have different stored procedure semantics/syntax.

Stored procedure queries cannot be paged with `setFirstResult()/setMaxResults()`.

Expand Down
Expand Up @@ -25,7 +25,7 @@ Session (`org.hibernate.Session`):: A single-threaded, short-lived object concep
In JPA nomenclature, the `Session` is represented by an `EntityManager`.
+
Behind the scenes, the Hibernate `Session` wraps a JDBC `java.sql.Connection` and acts as a factory for `org.hibernate.Transaction` instances.
It maintains a generally "repeatable read" persistence context (first level cache) of the application's domain model.
It maintains a generally "repeatable read" persistence context (first level cache) of the application domain model.

Transaction (`org.hibernate.Transaction`):: A single-threaded, short-lived object used by the application to demarcate individual physical transaction boundaries.
`EntityTransaction` is the JPA equivalent and both act as an abstraction API to isolate the application from the underling transaction system in use (JDBC or JTA).
`EntityTransaction` is the JPA equivalent and both act as an abstraction API to isolate the application from the underlying transaction system in use (JDBC or JTA).
Expand Up @@ -17,7 +17,7 @@ The following settings control this behavior.
`hibernate.jdbc.batch_versioned_data`::
Some JDBC drivers return incorrect row counts when a batch is executed.
If your JDBC driver falls into this category this setting should be set to `false`.
Otherwise it is safe to enable this which will allow Hibernate to still batch the DML for versioned entities and still use the returned row counts for optimistic lock checks.
Otherwise, it is safe to enable this which will allow Hibernate to still batch the DML for versioned entities and still use the returned row counts for optimistic lock checks.
Since 5.0, it defaults to true. Previously (versions 3.x and 4.x), it used to be false.

`hibernate.jdbc.batch.builder`::
Expand Down Expand Up @@ -48,14 +48,14 @@ include::{sourcedir}/BatchTest.java[tags=batch-session-batch-example]
----
====

There are several problems associated to this example:
There are several problems associated with this example:

. Hibernate caches all the newly inserted `Customer` instances in the session-level c1ache, so, when the transaction ends, 100 000 entities are managed by the persistence context.
If the maximum memory allocated to the JVM is rather low, this example could fails with an `OutOfMemoryException`.
The Java 1.8 JVM allocated either 1/4 of available RAM or 1Gb, which can easily accommodate 100 000 objects on the heap.
. long-running transactions can deplete a connection pool so other transactions don't get a chance to proceed.
. JDBC batching is not enabled by default, so every insert statement requires a database roundtrip.
To enable JDBC batching, set the property `hibernate.jdbc.batch_size` to an integer between 10 and 50.
To enable JDBC batching, set the `hibernate.jdbc.batch_size` property to an integer between 10 and 50.

[NOTE]
====
Expand Down
Expand Up @@ -10,7 +10,7 @@ The process is very different for each.
====
This chapter will not focus on all the possibilities of bootstrapping.
Those will be covered in each specific more-relevant chapters later on.
Instead we focus here on the API calls needed to perform the bootstrapping.
Instead, we focus here on the API calls needed to perform the bootstrapping.
====

[TIP]
Expand All @@ -30,13 +30,13 @@ For a discussion of the legacy bootstrapping API, see <<appendices/Legacy_Bootst

The first step in native bootstrapping is the building of a `ServiceRegistry` holding the services Hibernate will need during bootstrapping and at run time.

Actually we are concerned with building 2 different ServiceRegistries.
Actually, we are concerned with building 2 different ServiceRegistries.
First is the `org.hibernate.boot.registry.BootstrapServiceRegistry`.
The `BootstrapServiceRegistry` is intended to hold services that Hibernate needs at both bootstrap and run time.
This boils down to 3 services:

`org.hibernate.boot.registry.classloading.spi.ClassLoaderService`:: which controls how Hibernate interacts with `ClassLoader`s
`org.hibernate.integrator.spi.IntegratorService`:: which controls the management ands discovery of `org.hibernate.integrator.spi.Integrator` instances.
`org.hibernate.integrator.spi.IntegratorService`:: which controls the management and discovery of `org.hibernate.integrator.spi.Integrator` instances.
`org.hibernate.boot.registry.selector.spi.StrategySelector`:: which control how Hibernate resolves implementations of various strategy contracts.
This is a very powerful service, but a full discussion of it is beyond the scope of this guide.

Expand Down Expand Up @@ -106,7 +106,7 @@ include::{sourcedir}/BootstrapTest.java[tags=bootstrap-event-listener-registrati
[[bootstrap-native-metadata]]
==== Building the Metadata

The second step in native bootstrapping is the building of a `org.hibernate.boot.Metadata` object containing the parsed representations of an application's domain model and its mapping to a database.
The second step in native bootstrapping is the building of a `org.hibernate.boot.Metadata` object containing the parsed representations of an application domain model and its mapping to a database.
The first thing we obviously need to build a parsed representation is the source information to be parsed (annotated classes, `hbm.xml` files, `orm.xml` files).
This is the purpose of `org.hibernate.boot.MetadataSources`:

Expand Down Expand Up @@ -240,4 +240,4 @@ include::{sourcedir}/BootstrapTest.java[tags=bootstrap-native-EntityManagerFacto
----
====

The `integrationSettings` allows the application develoepr to customize the bootstrapping process by specifying different `hibernate.integrator_provider` or `hibernate.strategy_registration_provider` integration providers.
The `integrationSettings` allows the application developer to customize the bootstrapping process by specifying different `hibernate.integrator_provider` or `hibernate.strategy_registration_provider` integration providers.

0 comments on commit 9570f11

Please sign in to comment.