Spring Data JPA Tutorial

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.

Spring Data JPA: Getting Started Tutorials

Spring Data CrudRepository Tutorials

Spring Data JPA Query Method Tutorials

Spring Data JPA - Repository Methods Examples

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
  • Spring Data JPA Pagination and Sorting

    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 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.