SpringData Series II Interface Repository

This section describes the Repository interface specification, and sub-interfaces

  1. Repository is an empty interface, i.e. the interface standard
  2. 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.
  3. In fact annotations can also be defined by way of an interface Repository
      PersonRepository.java

     

  4. 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

Guess you like

Origin www.cnblogs.com/morganlin/p/12000201.html