The PagingAndSortingRepository interface

The PagingAndSortingRepository defines methods that provide the functionality to divide the ResultSet into pages as well as sort the results:

   public interface PagingAndSortingRepository<T, ID extends     Serializable>     extends CrudRepository<T, ID> {       Iterable<T> findAll(Sort sort);       Page<T> findAll(Pageable pageable);    }

We will look at examples of using the Sort class and Page, Pageable interfaces in the section on Spring Data JPA.

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.