JPA (Java Persistence API)?
JPA provides mechanism for Java ORM(Object relational mapping) technology. In easy terms, it is the Java Specification, rather than the implementation.
What is ORM?
ORM is a technology that maps Object and relational database. Imagine, we are trying to develop a system that contains Teams and Members. Each team contains members and only the single member can not have multiple teams. In Object world, we can use inheritance to demonstrate the team-member relationship. However, in database world, we have to demonstrate relational architecture of team-member relationship. This is when ORM framework comes into play and maps those two: Object and Relational Database, smoothly so that developers do not have to worry about mapping them.
JPA is not a library, rather a composite of interface to use ORM.
This composition of interface, is a simple blue print, therefore there is no implementation for it. In Java application, this is one of the methods to declare of how to use relational database. Therefore, we need an actual implementation in order to use this JPA.
Hibernate?
Hibernate uses common standards of Java Persistence API. In easy words, this is one of the implementations of JPA.
Hibernate inherits the core of JPA : EntityManagerFactory, EntityManager, EntityTransaction and implements them. Hibernate, internally, uses JDBC to interact with relational database after connecting to the database. Others that are like Hibernate are EclipseLink and DataNucleus as shown in the above JPA Implementations.
Spring Data JPA?
Spring Data JPA provides Repository Interface that wraps JPA into another abstraction. This Spring Data JPA uses JPA implementations such as Hibernate to utilize JPA. With this, developers can easily access data. Spring Data JPA is very huge to cover therefore will write another post about it.
Wrap UP
JPA is API interface for ORM technology in Java Applications.
Hibernate is the implementations of JPA and uses JDBC internally to connect with db.
Spring Data JPA is a composite of modules provided by Spring that uses JPA internally.