Skip to content

Commit 1ea8d09

Browse files
DiegoKrupitzamp911de
authored andcommitted
Update documentation for repository Pageable and Sort arguments.
Replace outdated `null` acceptance for `Pageable` with `Pageable.unpaged()` `QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)` should does not accept null values since there is `Pageable.unpaged()`. Furthermore, the same applies to `PagingAndSortingRepository#findAll(Pageable pageable)`. Related ticket: spring-projects/spring-data-jpa/issues/2464 Closes #2574
1 parent dda102a commit 1ea8d09

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/main/java/org/springframework/data/repository/PagingAndSortingRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface PagingAndSortingRepository<T, ID> extends Repository<T, ID> {
4545
/**
4646
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
4747
*
48-
* @param pageable
48+
* @param pageable must not be {@literal null}.
4949
* @return a page of entities
5050
*/
5151
Page<T> findAll(Pageable pageable);

src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* @param <T>
3030
* @author Mark Paluch
3131
* @author Christoph Strobl
32+
* @author Diego Krupitza
3233
* @since 1.12
3334
* @see ListQueryByExampleExecutor
3435
*/
@@ -68,7 +69,7 @@ public interface QueryByExampleExecutor<T> {
6869
* {@link Page} is returned.
6970
*
7071
* @param example must not be {@literal null}.
71-
* @param pageable can be {@literal null}.
72+
* @param pageable must not be {@literal null}.
7273
* @return a {@link Page} of entities matching the given {@link Example}.
7374
*/
7475
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);

0 commit comments

Comments
 (0)