JDBC, JPA, Hibernate, JPARepository, PagingAndSortingRepository, CrudRepository
Short descriptions of JDBC, JPA, Hibernate, JPARepository, PagingAndSortingRepository and CrudRepository to give an idea where to use which
JDBC — JPA — Hibernate
JDBC (Java Database Connectivity) is an interface that communicate with a database. It’s the common API that our application code uses to communicate with the database.
JPA (Java Persistence API) is a Java standard that allows us to bind Java objects to records in a relational database (ORM — Object Relationship Mapping) by allowing to retrieve, store, update, and delete data in a relational database using these objects.
JPA serves as a layer of abstraction that hides the low-level JDBC calls from the developer, making database programming considerably easier.
Hibernate is an open-source, light-weight Java ORM framework. It is an implementation of JPA.
JPARepository — PagindAndSortingRepository — CrudRepository
There is a fine definition and a table for comparison here.
As an extra point, querying methods return List instead of Iterable in JpaRepository.
JpaRepository contains the full API of CrudRepository and PagingAndSortingRepository.
JpaRepository Interface (spring-data-jpa:2.5.6):
PagingAndSortingRepository Interface (spring-data-commons:2.5.6):
CrudRepository Interface (spring-data-commons:2.5.6):
There are also store-specific interfaces which eventually tighten the coupling when used so be careful choosing.