-
Notifications
You must be signed in to change notification settings - Fork 1.5k
findAll(Example<S> example, Pageable pageable)
should accept null.
#2464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The documentation bits mentioning |
As mentioned in spring-projects/spring-data-jpa#2464 `QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)` should not accept null values since there is `Pageable.unpaged()`. Furthermore, the same applies to `PagingAndSortingRepository#findAll(Pageable pageable)`. Related tickets spring-projects/spring-data-jpa/issues/2464 Closes spring-projects/spring-data-jpa/issues/2464
Ok this makes sense. Yeah so far I found another place where it is not mentioned explicitly to not allow null. |
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
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
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
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
Hey,
in the javadoc of
QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)
(can be found here) it sayspageable - can be null.
.I was curious what the default behaviour of spring-data-jpa is, when providing a null value and therefore added the following test in
org.springframework.data.jpa.repository.UserRepositoryTests
:When running the test I get the following exception.
As far as I can see the spring-data-jpa implementation of
QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)
is not conform with the documentation.Furthermore, I wanted to know what is the behaviour we can expect, when providing null? (This is not specified in the docu).
I actually can't thing of any real reason why
QueryByExampleExecutor#findAll(Example<S> example, Pageable pageable)
should allow NULL.Best
Diego
The text was updated successfully, but these errors were encountered: