This section describes the Repository interface specification, and sub-interfaces
- Repository is an empty interface, i.e. the interface standard
- If we define the interfaces inherited Repository, the interface can be recognized as an IOC container Repositoty Bean into the IOC container. The method further meet certain specifications can be defined in the interface.
- In fact annotations can also be defined by way of an interface Repository
PersonRepository.java
- Repository of sub-interfaces
org.springframework.data.repository.CrudRepository <T, ID>: implements a set of methods CRUD
org.springframework.data.repository.PagingAndSortingRepository <T, ID>: to achieve a set of methods associated tab ordering
org.springframework.data.jpa.repository.JpaRepository <T, ID>: implements a set of related specifications method JPA
Since the definition of interface inheritance JpaRepository Such a universal interface is the ability to control the data access layer.
Original link: https://www.cnblogs.com/zhaobingqing/p/6854439.html