Skip to content

Commit 95dd775

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 2f707f0 commit 95dd775

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
@@ -42,7 +42,7 @@ public interface PagingAndSortingRepository<T, ID> extends CrudRepository<T, ID>
4242
/**
4343
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
4444
*
45-
* @param pageable
45+
* @param pageable must not be {@literal null}.
4646
* @return a page of entities
4747
*/
4848
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
@@ -28,6 +28,7 @@
2828
* @param <T>
2929
* @author Mark Paluch
3030
* @author Christoph Strobl
31+
* @author Diego Krupitza
3132
* @since 1.12
3233
*/
3334
public interface QueryByExampleExecutor<T> {
@@ -66,7 +67,7 @@ public interface QueryByExampleExecutor<T> {
6667
* {@link Page} is returned.
6768
*
6869
* @param example must not be {@literal null}.
69-
* @param pageable can be {@literal null}.
70+
* @param pageable must not be {@literal null}.
7071
* @return a {@link Page} of entities matching the given {@link Example}.
7172
*/
7273
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);

0 commit comments

Comments
 (0)