FeaturesThis Spring module provides a set of interfaces to manipulate data in repositories:
- Repository - This is a marker interface indicating which object are going to access the repository.
- CrudRepository<T, ID extends Serializable> - This interface extends Repository and provides a set of CRUD (Create, Read, Update, Delete) methods to manipulate T objects having ID as a key.
- PageAndSortingRepository<T, ID extends Serializable> - This interface extends CrudRepository and provides method to fetch T objects in a sorted way or using pages.
- Pageable & PageRequest - The Pageable interface is implemented by PageRequest. Page requests are created to indicate which page and page sizes should be used to fetch objects from the PageAndSortingRepository interface.
- Page<T> - This interface contains the fetched objects returned for a given page request.
Then, copy the the repository methods you want to expose in this customized interface and Spring will deal with them.
There are situations where developers want to implement their own repository interfaces by extending the repository interfaces available in SDC. However, these interfaces should not be instantiated in their applications. To prevent this, they can use the @NoRepositoryBean on these customized interfaces.
More Spring related posts here.