You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
QuerydslMongoPredicateExecutor findAll() tries to get offset for a Pageable.unpaged() #3751
Hi,
When passing a Pageable.unpaged() to findAll(Predicate predicate, Pageable pageable) in the QuerydslMongoPredicateExecutor, it will try to call the pageable.getOffset() which will to a java.lang.UnsupportedOperationException.
I suppose this is a bug because the documentation of the findAll mentions that the pageable can be unpaged.
My expectation is that if the provided pageable is unpaged, then it would not apply pagination to the result and instead it would provide me an unpaged page with the available contents.
The PageableExecutionUtils.getPage(...) call seems to already do this but it never gets to be executed because it fails at the applyPagination(query, pageable) due to the call to pageable.getOffset() which results in the java.lang.UnsupportedOperationException when the pageable is unpaged.
So as it is right now yes in can take a Pageable.unpaged() but it will always result in a java.lang.UnsupportedOperationException, therefore it doesn't seem useful to me (unless I am missing something :) )
Thanks a lot. By checking the other implementations, Pageable.unpaged() should indeed return all results. The JPA module does already the right thing and we need to fix the issue in MongoDB.
Activity
mp911de commentedon Jul 26, 2021
What would you expect as a result from such a call?
sfgvieira commentedon Jul 26, 2021
My expectation is that if the provided pageable is unpaged, then it would not apply pagination to the result and instead it would provide me an unpaged page with the available contents.
The
PageableExecutionUtils.getPage(...)call seems to already do this but it never gets to be executed because it fails at theapplyPagination(query, pageable)due to the call topageable.getOffset()which results in the java.lang.UnsupportedOperationException when the pageable is unpaged.So as it is right now yes in can take a Pageable.unpaged() but it will always result in a java.lang.UnsupportedOperationException, therefore it doesn't seem useful to me (unless I am missing something :) )
mp911de commentedon Jul 26, 2021
Thanks a lot. By checking the other implementations,
Pageable.unpaged()should indeed return all results. The JPA module does already the right thing and we need to fix the issue in MongoDB.Run unpaged query using Pageable.unpaged() through QuerydslMongoPredi…
Run unpaged query using Pageable.unpaged() through QuerydslMongoPredi…
Run unpaged query using Pageable.unpaged() through QuerydslMongoPredi…