From 176be55c455213c31e33b6a3631f6542fec78f5f Mon Sep 17 00:00:00 2001 From: "nathan.xu" Date: Sat, 23 Nov 2024 11:52:43 -0500 Subject: [PATCH] fix some defects in repositories doc --- .../src/main/asciidoc/repositories/Configuration.adoc | 2 +- .../src/main/asciidoc/repositories/Repositories.adoc | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/documentation/src/main/asciidoc/repositories/Configuration.adoc b/documentation/src/main/asciidoc/repositories/Configuration.adoc index 2198d5148333..c2219ccb9aa4 100644 --- a/documentation/src/main/asciidoc/repositories/Configuration.adoc +++ b/documentation/src/main/asciidoc/repositories/Configuration.adoc @@ -60,7 +60,7 @@ annotationProcessor 'org.hibernate.orm:hibernate-processor:7.0.0.Final' === Excluding classes from processing -There's three ways to limit the annotation processor to certain classes: +There are three ways to limit the annotation processor to certain classes: 1. A given repository may be excluded from processing simply by specifying `@Repository(provider="acme")` where `"acme"` is any string other than the empty string or a string equal, ignoring case, to `"Hibernate"`. This is the preferred solution when there are multiple Jakarta Data Providers available. 2. A package or type may be excluded by annotating it with the link:{doc-javadoc-url}org/hibernate/annotations/processing/Exclude.html[`@Exclude`] annotation from `org.hibernate.annotations.processing`. diff --git a/documentation/src/main/asciidoc/repositories/Repositories.adoc b/documentation/src/main/asciidoc/repositories/Repositories.adoc index d6d58cc8c4ba..7f3df2040ffa 100644 --- a/documentation/src/main/asciidoc/repositories/Repositories.adoc +++ b/documentation/src/main/asciidoc/repositories/Repositories.adoc @@ -358,7 +358,7 @@ This is our first glimpse of the advantages of using Jakarta Data repositories w ==== If there is no `Book` with the given `isbn` in the database, the method throws `EmptyResultException`. -There's two ways around this if that's not what we want: +There are two ways around this if that's not what we want: - declare the method to return `Optional`, or - annotate the method `@jakarta.annotation.Nullable`. @@ -405,7 +405,7 @@ Furthermore, if the parameter type is a list or array of the entity field type, List books(String[] ibsn); ---- -Or course, an automatic query method might have multiple parameters. +Of course, an automatic query method might have multiple parameters. [source,java] ---- @@ -468,7 +468,7 @@ List booksByTitle(String pattern); You might notice that: - The `from` clause is not required in JDQL, and is inferred from the return type of the repository method. -- Since Jakarta Persistence 3.2, neither the `select` cause nor entity aliases (identification variables) are required in JPQL, finally standardizing a very old feature of HQL. +- Since Jakarta Persistence 3.2, neither the `select` clause nor entity aliases (identification variables) are required in JPQL, finally standardizing a very old feature of HQL. This allows simple queries to be written in a very compact form. @@ -499,7 +499,7 @@ The JPQL specification provides the `select new` construct for this. [source,java] ---- -@Query("select new AuthorBookSummary(b.isbn, a.ssn, a.name, b.title " + +@Query("select new AuthorBookSummary(b.isbn, a.ssn, a.name, b.title) " + "from Author a join books b " + "where title like :pattern") List summariesForTitle(String pattern);