1. Use of repository objects in the project
2.Repository introduced in two ways
Inheritance and use annotations
Definition of the 3.Repository interface
The Repository interface is a core interface of Spring Data and does not provide any methods, and developers need to declare the required methods in their own defined interfaces.
public interface Repository<T, ID extends Serializable> { }
Hierarchical relationship of 4.Repository interfaces
The underlying Repository provides the most basic data access functionality, and several of its sub-interfaces extend functionality. Their inheritance relationships are as follows:
Repository: Just an identity, indicating that any inherited it is a warehouse interface class
(1) Crudrepository: Inherit Repository, implement a set of CRUD related methods
(2) Pagingandsortingrepository: Inherit crudrepository, realize a component page sort related method
(3) Jparepository: Inheriting pagingandsortingrepository, implementing a set of JPA specification-related methods
The custom xxxxrepository needs to inherit the jparepository, so the Xxxxrepository interface has the capability of a common data access control layer.
Jpaspecificationexecutor: Does not belong to the repository system, implements a set of JPA Criteria query related methods.
Basic knowledge of SPRING-DATA-JPA repository