How do I pass a Pageable
object to Spring JPA Repository with only Sorting information?
I want something like this:
Pageable pageable = PageRequest.of(null, null, Sort());
I know it takes int
as page
and size
but if we can somehow not use those values and give an unpaged result with only
Sort.by(Sort.Direction.ASC, "age")
We could use a high number like 1000
, 1000
for page and size but I do not want to hardcode these values.
I am also not looking to create a custom impl for Pageable
.
Please let me know how to achieve this.
Thanks in advance.