liveBook · Manning

Spring Data Commons

As explained in Java Persistence with Spring Data and Hibernate epub

Spring Data Commons is the shared Spring Data library containing common infrastructure, metadata abstractions, and repository interfaces.

Spring Data Commons is the shared infrastructure layer for the Spring Data family. It supplies a metadata model for persistent Java classes and technology-neutral repository interfaces, allowing different database modules to use common persistence concepts. section 2.2

Its role is architectural rather than database-specific. Spring Data JPA implements JPA-based repositories, Spring Data JDBC supports JDBC access, and other modules adapt the repository style to REST, MongoDB, or Redis. section 2.2

The shared layer provides:

  • Metadata describing how persistent Java classes participate in object and relational persistence. section 1.3 section 2.2
  • Repository interfaces that remain independent of a particular persistence technology. section 2.2
  • A foundation used by specialized modules that reduce data-access boilerplate while adding store-specific capabilities. section 1.3 section 2.2

Choosing the persistence layer

An application can use Spring Data Commons concepts while selecting Spring Data JPA for a JPA implementation such as Hibernate, Spring Data JDBC for simpler JDBC access, or Spring Data MongoDB for a document database. The shared repository style does not make these modules equivalent: JDBC omits capabilities such as caching and lazy loading, while JPA retains JPA features. section 1.3 section 2.2

How Java Persistence with Spring Data and Hibernate epub covers it

How deep it goes
Defines the common model and interfaces, but leaves database access and capabilities to specialized modules.
Examples
Names Spring Data JPA, Spring Data JDBC, Spring Data REST, Spring Data MongoDB, and Spring Data Redis as module examples.
What it assumes
Assumes familiarity with relational modeling and SQL while distinguishing JPA specifications from Hibernate implementations.
What you can do after
Evaluate persistence architectures by separating shared repository abstractions from JPA, JDBC, document, and key/value implementations.
How it connects
Connects Spring Data with JPA, Hibernate, JDBC, REST, MongoDB, Redis, and repository interfaces.

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.