Spring Data JPA

Introduction to Spring Data JPA and Spring Data Commons


  • Introduction to JPA
  • Understanding of JpaQL and SQL.
  • Understanding of ORM
  • A workstation running Windows, Linux, or Mac OS.
  • LDS Tech or other IDE installed.
  • Stack Pet Store Admin Web project installed and ready to use (see section below).
  • Java JDK 1.6+
  • Internet Connection (Specifically to the LDS Pet Store Development Database)

Getting Pet Store Admin Web Setup

  • Check Out as a Maven Project into your IDE - Pet Store 3.3.1 tag ( )
  • Locate the property files located in stack-pet-store-admin-web/src/test/resources/testenv. You should see a and a Open the and copy the 3 properties and paste them in the file. Make sure you remove or overwrite the existing properties in with the new and save the file. This step is switching your local test environment to use the Pet Store Development Oracle database instead of a local XE Oracle database.
  • Open the AnimalRepositoryIT test located in the stack-pet-store-admin-web/src/test/java/org/lds/stack/petstore/admin/repository folder (package).
  • Run the AnimalRepositoryIT test as a TestNG test. If everything passes then you are setup and ready for the class. Otherwise make sure that the project and your IDE are setup correctly and you are able to access the Stack Pet Store Development database.

Course Outline

Introduction To Spring Data JPA

  • Training Overview
  • Prerequisites
  • What is Spring Data JPA?
  • Where we’ve been to get here
  • Spring Data JPA Pros and Cons
  • Setting up Spring Data JPA in a project
  • Lab 1 (Send email in own words describing what Spring Data JPA is)

Spring Data JPA in Depth

  • Repositories vs. Services
  • CrudRepositories
  • PagingAndSortingRepository
  • Spring Data JPA Repositories
  • DSL Queries
  • Lab 2 (Add DSL Queries to AnimalRepository)
  • Using @Query
  • Using @query with native queries
  • Lab 3 (Add @Query to AnimalRepository)
  • Paging
  • Sorting
  • Lab 4 (Add paging example to AnimalRepository)

Replacing LDS ServiceProxy with JPA Repositories

  • Reducing Query Code
  • Migration Strategy



This page was last modified on 21 August 2013, at 08:35.

Note: Content found in this wiki may not always reflect official Church information. See Terms of Use.