Skip to content
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

Add a findAll that takes a Pageable and returns a Slice instead of a Page #558

Open
simasch opened this issue Jan 26, 2023 · 2 comments
Open

Comments

@simasch
Copy link

simasch commented Jan 26, 2023

The PagingAndSortingRepository has a Page<T> findAll(Pageable pageable) method.

The problem is that returning a Page will result in a count and a select statement.

The same problem is present in JpaSpecificationExecutor. So it would be awesome to have this covered as well.

@simasch simasch changed the title Add a findAll that takes a Pageable returns a Slice instead of a Page Add a findAll that takes a Pageable and returns a Slice instead of a Page Jan 26, 2023
@vladmihalcea
Copy link
Owner

So, should we define findAll that returns a Slice instead?

One option would be to avoid extending any base interface and create additional interfaces that provide this extra functionality:

  • PagingBaseJpaRepository
  • SlicingBaseJpaRepository

@simasch
Copy link
Author

simasch commented Jan 26, 2023

+1 for the additional interfaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants