This page contains a list of Spring Data JPA tutorials and examples. The goal of the Spring Data JPA module is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores.
Important: All the Spring Data JPA Tutorials are upgraded to use Spring Boot 3 and Java 17.
YouTube Video - Free Spring Data JPA Tutorial
Application Architecture
In typical three-layer Spring application architecture, we create three layers - Controller, Service, and DAO/Repository layer.
If we use JPA/Hibernate then write a lot of coding while implementing DAO/Repository layer.
We can use Spring Data JPA to reduce the amount of boilerplate code required to implement the data access object (DAO) layer.
Spring Data JPA is not a JPA provider. It is a library/framework that adds an extra layer of abstraction on top of our JPA provider (like Hibernate).
Spring Data JPA uses Hibernate as a default JPA provider.Spring Data JPA: Getting Started Tutorials
- Spring Data JPA Tutorial - Getting Started // Popular
- Spring Data JPA CRUD Example Tutorial // Popular
Spring Data CrudRepository Tutorials
- Spring Data CrudRepository - save() Method
- Spring Data CrudRepository - saveAll() Method
- Spring Data CrudRepository - findById() Method
- Spring Data CrudRepository - findAll() Method
- Spring Data CrudRepository - deleteById() Method
- Spring Data CrudRepository - delete() Method
- Spring Data CrudRepository - deleteAll() Method
- Spring Data CrudRepository - existsById() Method
- Spring Data CrudRepository - count() Method
Spring Data JPA Query Method Tutorials
Spring Data JPA Pagination and Sorting
- Spring Data JPA - Pagination Example
- Spring Data JPA - Sorting Example
- Spring Data JPA - Sorting with Multiple Fields or Columns
- Spring Data JPA - Pagination and Sorting Example
- Pagination and Sorting with Spring Boot, ThymeLeaf, Spring Data JPA, Hibernate, MySQL
- Pagination and Sorting using Spring Data JPA - PagingAndSortingRepository
Spring Data JPA + Hibernate Mappings
Spring Data JPA Testing - Repository Layer Testing
API Mapping of Spring Data JPA and JPA
The SimpleJpaRepository class provides the default implementation of a Repository interface. SimpleJpaRepository class internally uses JPA EntityManager to map its methods with JPA EntityManager interface methods.
It is better to know which JPA EntityManager method is being called by methods of Repository interface (SimpleJpaRepository class ) of Spring Data JPA.
The JPA methods called the main methods of the Repository interface of Spring Data JPA are shown below.
Basic Spring Data JPA Flow
Once you completed reading above all articles then let's understand the basic flow at the time of accessing the database using Spring Data JPA is shown below.
Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours
Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course