Spring Data JPA
What is Spring Data JPA?
Spring Data JPA provides an abstraction for working with JPA providers like Hibernate. Using Spring Data JPA allows developers to quickly implement data access repositories without writing boilerplate code associated with JPA providers.
What is a JPA provider anyways?
A JPA provider implements the Java Persistence API (JPA) specification. The JPA specification defines how Java objects can represent and persist data stored in database tables. You can think of the JPA as a set of interfaces that need to be implemented. ORM libraries like Hibernate provide those implementations.
Spring Data JPA vs Hibernate
Spring Data JPA and Hibernate are not competitors. In fact, Spring Data JPA uses Hibernate (or alternate JPA provider) under the hood. Spring Data JPA simply serves as an abstraction for more easily working with ORM libraries like Hibernate.
For more information be sure to check out Spring Data JPA vs Hibernate.
Spring Data JPA Example
A good example for demonstrating Spring Data JPA can be found here. See how this example