Spring Data JPA is not a JPA provider but is a specification. It is a library / framework that adds an extra layer of abstraction on the top of our JPA provider. It simply “hides” the Java Persistence API (and the JPA provider) behind its repository abstraction.
JPA is the sun specification for persisting objects in the enterprise application. It is used as replacement for complex entity beans.
The implementation of JPA specification are provided by many JPA provider such as: Hibernate, Toplink, iBatis, OpenJPA etc.
Features provided by Spring Data JPA :
- Create and support repositories created with Spring and JPA
- Support JPA queries
- Support for batch loading, sorting, dynamical queries
- Supports XML mapping for entities
- Reduce code size for generic CRUD operations by using CrudRepository
- The JDBC driver which enables java application to interact with the database.
- The datasource provides all technical information needed to access data.
- The JPA Provider implements the Java Persistence API. We use Hibernate because it is the most common JPA provider.
- Spring Data JPA hides the used JPA provider behind its repository abstraction.
What Components Do We Need :