Skip to content

Commit 185fe9b

Browse files
hoyeonj981mp911de
authored andcommitted
Fix typos in query-methods.adoc.
Signed-off-by: hoyeon Jang <[email protected]> Closes #3912
1 parent f1f010c commit 185fe9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/antora/modules/ROOT/pages/jpa/query-methods.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ NOTE: `In` and `NotIn` also take any subclass of `Collection` as a parameter as
7474
====
7575
`DISTINCT` can be tricky and not always producing the results you expect.
7676
For example, `select distinct u from User u` will produce a complete different result than `select distinct u.lastname from User u`.
77-
In the first case, since you are including `User.id`, nothing will duplicated, hence you'll get the whole table, and it would be of `User` objects.
77+
In the first case, since you are including `User.id`, nothing will be duplicated, hence you'll get the whole table, and it would be of `User` objects.
7878
7979
However, that latter query would narrow the focus to just `User.lastname` and find all unique last names for that table.
8080
This would also yield a `List<String>` result set instead of a `List<User>` result set.
@@ -83,7 +83,7 @@ This would also yield a `List<String>` result set instead of a `List<User>` resu
8383
`countDistinctByLastname(String lastname)` can also produce unexpected results.
8484
Spring Data JPA will derive `select count(distinct u.id) from User u where u.lastname = ?1`.
8585
Again, since `u.id` won't hit any duplicates, this query will count up all the users that had the binding last name.
86-
Which would the same as `countByLastname(String lastname)`!
86+
Which would be the same as `countByLastname(String lastname)`!
8787
8888
What is the point of this query anyway? To find the number of people with a given last name? To find the number of _distinct_ people with that binding last name?
8989
To find the number of _distinct last names_? (That last one is an entirely different query!)
@@ -394,7 +394,7 @@ You have multiple options to consume large query results:
394394
You have learned in the previous chapter about `Pageable` and `PageRequest`.
395395
2. <<repositories.scrolling.offset,Offset-based scrolling>>.
396396
This is a lighter variant than paging because it does not require the total result count.
397-
3. <<repositories.scrolling.keyset,Keyset-baset scrolling>>.
397+
3. <<repositories.scrolling.keyset,Keyset-based scrolling>>.
398398
This method avoids https://use-the-index-luke.com/no-offset[the shortcomings of offset-based result retrieval by leveraging database indexes].
399399

400400
Read more on <<repositories.scrolling.guidance,which method to use best>> for your particular arrangement.

0 commit comments

Comments
 (0)