Skip to content

Commit

Permalink
Mention ListPagingAndSortingRepository in documentation.
Browse files Browse the repository at this point in the history
Closes #2960
Original pull request: #2961
  • Loading branch information
schauder authored and mp911de committed Nov 10, 2023
1 parent 3c872ae commit 02d780f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The methods declared in this interface are commonly referred to as CRUD methods.
NOTE: We also provide persistence technology-specific abstractions, such as `JpaRepository` or `MongoRepository`.
Those interfaces extend `CrudRepository` and expose the capabilities of the underlying persistence technology in addition to the rather generic persistence technology-agnostic interfaces such as `CrudRepository`.

Additional to the `CrudRepository`, there is a {spring-data-commons-javadoc-base}/org/springframework/data/repository/PagingAndSortingRepository.html[`PagingAndSortingRepository`] abstraction that adds additional methods to ease paginated access to entities:
Additional to the `CrudRepository`, there are {spring-data-commons-javadoc-base}/org/springframework/data/repository/PagingAndSortingRepository.html[`PagingAndSortingRepository`] and {spring-data-commons-javadoc-base}/org/springframework/data/repository/ListPagingAndSortingRepository.html[`ListPagingAndSortingRepository`] which adds additional methods to ease paginated access to entities:

.`PagingAndSortingRepository` interface
[source,java]
Expand All @@ -61,6 +61,8 @@ PagingAndSortingRepository<User, Long> repository = // … get access to a bean
Page<User> users = repository.findAll(PageRequest.of(1, 20));
----

`ListPagingAndSortingRepository` offers equivalent methods, but returns a `List` where the `PagingAndSortingRepository` methods return an `Iterable`.

ifdef::feature-scroll[]
In addition to pagination, scrolling provides a more fine-grained access to iterate through chunks of larger result sets.
endif::[]
Expand Down

0 comments on commit 02d780f

Please sign in to comment.