liveBook · Manning

Chapter 14: Implementing data persistence with Spring Data

What you will learn in chapter 14 of Spring Start Here, Second Edition

Introduces the persistence layer and explains how Spring Data reduces the code needed to work with database data.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces the persistence layer and explains how Spring Data reduces the code needed to work with database data.

Key terms: persistence layer, Spring Data, repository interfaces, implementations at runtime

14.1 What Spring Data is

This section explains why varied persistence technologies make repository development complex and how Spring Data simplifies it through common abstractions and provided implementations.

Key terms: persistence technology, persistence layer, repositories, JDBC, JdbcTemplate, Hibernate, Spring Data, abstractions, interfaces, implementations

14.2 How Spring Data works

The section explains how Spring Data modules provide persistence support through a hierarchy of repository interfaces, including technology-specific contracts.

Key terms: Spring Data, module, Maven dependency, Spring Data JDBC, Repository, CrudRepository, PagingAndSortingRepository, marker interface, CRUD, paging

14.3 Using Spring Data JDBC

This section builds a Spring Data JDBC repository for an electronic wallet and uses it to transfer money between accounts.

Key terms: H2 in-memory database, schema.sql, data.sql, Account, @Id, AccountRepository, CrudRepository, dynamic implementation, bean, findAll()

14.4 Questions

This section provides review questions on Spring Data concepts, with answers in Appendix A.

14.5 Summary

This summary explains how Spring Data uses technology-specific modules and repository interfaces to provide persistence operations, including custom queries.

Where this is used later

Concepts explained in this chapter

← Chapter 13: Using transactions in Spring apps Chapter 15: Unit testing in Spring apps →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.