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
