Browse Source

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
pull/2592/head
Diego Krupitza 4 years ago committed by Mark Paluch
parent
commit
43bba35dec
No known key found for this signature in database
GPG Key ID: 4406B84C1661DCD1
  1. 2
      src/main/java/org/springframework/data/repository/PagingAndSortingRepository.java
  2. 3
      src/main/java/org/springframework/data/repository/query/QueryByExampleExecutor.java

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

@ -42,7 +42,7 @@ public interface PagingAndSortingRepository<T, ID> extends CrudRepository<T, ID> @@ -42,7 +42,7 @@ public interface PagingAndSortingRepository<T, ID> extends CrudRepository<T, ID>
/**
* Returns a {@link Page} of entities meeting the paging restriction provided in the {@code Pageable} object.
*
* @param pageable
* @param pageable must not be {@literal null}.
* @return a page of entities
*/
Page<T> findAll(Pageable pageable);

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

@ -29,6 +29,7 @@ import org.springframework.data.domain.Sort; @@ -29,6 +29,7 @@ import org.springframework.data.domain.Sort;
* @param <T>
* @author Mark Paluch
* @author Christoph Strobl
* @author Diego Krupitza
* @since 1.12
*/
public interface QueryByExampleExecutor<T> {
@ -67,7 +68,7 @@ public interface QueryByExampleExecutor<T> { @@ -67,7 +68,7 @@ public interface QueryByExampleExecutor<T> {
* {@link Page} is returned.
*
* @param example must not be {@literal null}.
* @param pageable can be {@literal null}.
* @param pageable must not be {@literal null}.
* @return a {@link Page} of entities matching the given {@link Example}.
*/
<S extends T> Page<S> findAll(Example<S> example, Pageable pageable);

Loading…
Cancel
Save