1. Spring Data JPA是什么东东?
Hibernate is the most common JPA Provider.
- Spring Data JPA provides support for creating JPA repositories by extending the Spring Data repository interfaces.
- Spring Data Commons provides the infrastructure that is shared by the datastore specific Spring Data projects.
- The JPA Provider implements the Java Persistence API (JPA).
The repository hierarchy looks as follows:
JPA is an specification while Hibernate is a particular implementation of that specification (these implementations are usually referred to as Providers).
- Spring Data JPA is not a JPA provider. It simply “hides” the Java Persistence API (and the JPA provider) behind its repository abstraction.
- Spring Data provides multiple repository interfaces that are used for different purposes.