Browse Source

Add `Limit` parameter to section in reference documentation.

Closes #3006
Original pull request: #3007
pull/3026/head
Christoph Strobl 2 years ago committed by Mark Paluch
parent
commit
d3a56e668b
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 7
      src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc

7
src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc

@ -454,9 +454,10 @@ ifdef::feature-scroll[] @@ -454,9 +454,10 @@ ifdef::feature-scroll[]
endif::[]
[[repositories.limit-query-result]]
== Limiting Query Results
=== Limiting Query Results
You can limit the results of query methods by using the `first` or `top` keywords, which you can use interchangeably.
In addition to paging it is possible to limit the result size using a dedicated `Limit` parameter.
You can also limit the results of query methods by using the `first` or `top` keywords, which you can use interchangeably but may not be mixed with a `Limit` parameter.
You can append an optional numeric value to `top` or `first` to specify the maximum result size to be returned.
If the number is left out, a result size of 1 is assumed.
The following example shows how to limit the query size:
@ -464,6 +465,8 @@ The following example shows how to limit the query size: @@ -464,6 +465,8 @@ The following example shows how to limit the query size:
.Limiting the result size of a query with `Top` and `First`
[source,java]
----
List<User> findByLastname(Limit limit);
User findFirstByOrderByLastnameAsc();
User findTopByOrderByAgeDesc();

Loading…
Cancel
Save