hypersistence-utils icon indicating copy to clipboard operation
hypersistence-utils copied to clipboard

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

Open simasch opened this issue 2 years ago • 6 comments

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 avatar Jan 26 '23 10:01 simasch

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

vladmihalcea avatar Jan 26 '23 10:01 vladmihalcea

+1 for the additional interfaces

simasch avatar Jan 26 '23 10:01 simasch