liveBook · Manning

Spring Data

As explained in Java Persistence with Spring Data and Hibernate epub

Spring Data is a family of Spring projects that provides consistent data-access abstractions across relational and nonrelational persistence technologies.

Spring Data is a family of Spring projects that simplifies access to relational and NoSQL databases. Its common approach to data access does not erase differences between stores: each module retains the capabilities of its underlying technology. section 2.2 section 4.0

For relational persistence, distinguish the layers. JPA specifies APIs and object/relational mappings; Hibernate can implement JPA; Spring Data JPA sits above a JPA implementation. It creates implementations of repository interfaces and can generate queries from method names, reducing persistence-layer boilerplate. JPA and Hibernate still define and manage the entities. section 1.3 section 2.2 section 4.0

Choose a module by the store and capabilities the application needs:

  • Spring Data Commons supplies a metadata model for persistent Java classes and technology-neutral repository interfaces. section 2.2
  • Spring Data JPA supports JPA-based repositories; Spring Data JDBC supports JDBC-based repositories but omits JPA capabilities such as caching and lazy loading. section 2.2
  • Spring Data REST exports repositories as RESTful resources; Spring Data MongoDB supports document-database access; Spring Data Redis provides abstractions for key/value access. section 2.2

Spring Data JPA can take responsibility for configuration and transaction management, with Spring integration through JavaConfig or XML. Less handwritten data-access code does not remove the need to understand SQL: inspect generated queries and their performance implications, and anticipate the code that repository abstractions generate. section 4.0 section 1.3

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Distinguishes modules and explains repository generation, configuration, and transactions; defers detailed query-building mechanisms.
Examples
Compares a Hello World persistence application across JPA, Hibernate, and Spring Data.
What it assumes
Assumes familiarity with Java and enough relational modeling and SQL to interpret generated database statements.
What you can do after
Apply it via Spring Data JPA repositories while accounting for generated queries and the underlying JPA provider.
How it connects
Connects repositories to JPA, Hibernate, JDBC, REST, MongoDB, Redis, SQL, and Spring Boot.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Java Persistence with Spring Data and Hibernate epub. The section links point to the parts of the book it draws on.