Introduction
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 - 3 Hours Course
Spring Data JPA: Getting Started Tutorials
- Spring Data JPA Tutorial - Getting Started // Popular
- How to use Spring Data JPA in Spring Boot Project // Popular
- Spring Data JPA Tutorial - Java-Based Configuration
- Spring Data JPA - Query Creation from Method Names // Popular
- Spring Data JPA - Creating Database Queries With Named Queries
- Spring Data JPA @NamedNativeQuery and @NamedNativeQueries Example
- Spring Data JPA - @NamedQuery Example
- Spring Data JPA - @NamedQueries Example
- Spring Data JPA - Creating Database Queries using @Query Annotation
- Spring Data JPA - Auditing with Spring Boot 2 and MySQL Example // Popular
- Spring Data JPA - Working with Multiple Datasources using Spring Boot
- Spring @Repository Annotation
- Spring MVC 5 + Spring Data JPA + Hibernate 5 + JSP + MySQL Tutorial
- Spring Data REST Tutorial
- Spring Boot CRUD Tutorial with Spring MVC, Spring Data JPA, Thymeleaf, Hibernate, MySQL
- 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 Query Method - Multiple Fields
- Spring Data JPA Query Method - Distinct
- Spring Data JPA Query Method - Greater Than
- Spring Data JPA Query Method - Less Than
- Spring Data JPA Query Method - Between
- Spring Data JPA Query Method - Like
- Spring Data JPA Query Method - IN Clause
Spring Data JPA - Repository Methods Examples
- Spring Data JPA - save() Method Example
- Spring Data JPA - saveAll() Method Example
- Spring Data JPA - findById() Method Example
- Spring Data JPA - findAll() Method Example
- Spring Data JPA - count() Method Example
- Spring Data JPA - deleteById() Method Example
- Spring Data JPA - delete() Method Example
- Spring Data JPA - deleteAll() Method Example
- Spring Data JPA - Distinct Query Method Example
- Spring Data JPA - GreaterThan Query Method Example
- Spring Data JPA - LessThan Query Method Example
- Spring Data JPA - Containing Query Method Example
- Spring Data JPA - Like Query Method Example
- Spring Data JPA - Between Query Method Example
- Spring Data JPA - Date Range Between Query Method Example
- Spring Data JPA - In Clause Query Method Example
Spring Data JPA Query Examples
- Spring Data JPA - findByName
- Spring Data JPA findBy Column Name Example
- Spring Data JPA findBy Multiple Columns
- Spring Data JPA existsBy Multiple Columns
- Spring Data JPA findBy Order By
- Spring Data JPA findBy Nested Object
- Spring Data JPA findBy Child Property
- Spring Data JPA findBy Multiple IDs
- Spring Data JPA deleteBy Column
- Spring Data JPA Delete Multiple Rows
- Spring Boot JPA Batch Insert Example
- Spring Data JPA deleteBy List of IDs
- Spring Data JPA Delete Native Query
- Spring Data JPA Find by Enum Value
- Spring Data JPA Find Max Value
- Spring Data JPA @Query Inner Join
- Spring Data JPA Specification Example
- Spring Data JPA Specification With Pagination
- Spring Data JPA Specific Columns using JPQL and DTO Projections
- Spring Data JPA DTO Projection Example
- Eager and Lazy Loading in Hibernate
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 One-to-One Unidirectional Mapping
- Spring Data JPA One-to-One Bidirectional Mapping
- Spring Data JPA One to Many Unidirectional Mapping
- Spring Data JPA One to Many Bidirectional Mapping
- Spring Data JPA Many to Many Unidirectional Mapping
- Spring Data JPA Many to Many Bidirectional Mapping
Spring Data JPA Testing - Repository Layer Testing
- Spring Data JPA Repository Testing using Spring Boot @DataJpaTest // Popular
- Spring Boot Testing - Data Access Layer Integration Testing using Testcontainers
- CRUD JUnit Tests for Spring Data JPA - Testing Repository Layer // Popular
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 the Repository interface (SimpleJpaRepository
class) of Spring Data JPA.
The JPA methods called by the main methods of the Repository interface of Spring Data JPA are shown below:
Basic Spring Data JPA Flow
Once you have completed reading all the articles above, let's understand the basic flow of accessing the database using Spring Data JPA, as shown below:
This page categorizes the Spring Data JPA tutorials and provides a comprehensive guide to various aspects of using Spring Data JPA, helping you efficiently implement data access layers in your Spring Boot applications.
Nice Tutorial. Really Informative.
ReplyDeleteCan you post sample working Java examples for below items
ReplyDelete1. Spring Data Java 8 Support
2. Spring Data Annotations
I went thru baeldung website but it's difficult to understand. There is no working code.
Yes, i will let you know once i will work on it.
DeleteYou are super awesome!!
ReplyDeleteCould you please post examples of Native query and resultMapping using spring data jpa
ReplyDelete