OSS TanbouSign in with GitHub

provide shared Repository, paging, auditing, and mapping APIs for datastore-specific Spring Data modules

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
840
Primary language
Java
License
Apache-2.0
Repository last updated
Oct 2, 2026
On this page

Overview

Spring Data Commons is the shared data-access infrastructure used by Spring Data modules. It supplies Repository interfaces, domain-type metadata, paging and sorting, auditing, and common machinery for query derivation from method names.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Express a consistent data-access boundary with Repository contracts

Repository and its derived interfaces describe data access around a domain type and its ID type. Datastore-specific modules implement these contracts and use the common infrastructure for query-method parsing and custom repository fragments.

Sources: [1][6]

Share paging and sorting types across datastore modules

Page carries content together with total element and page counts, while Pageable represents page number, size, and sorting. The same API can cross service and web-layer boundaries whether the backing module targets JPA, MongoDB, or another store.

Sources: [8][9]

Reuse domain metadata and auditing infrastructure

Commons provides a metadata model for persistent domain classes, created and modified user or timestamp auditing, and infrastructure intended for use across stores.

Sources: [1][7]

Best fit

Fits Spring Data modules, extensions, and shared application boundaries

It is useful when an application passes Repository or paging types across modules, and when library authors build datastore integrations or Spring Data extensions. A regular application can also use Page as a stable vocabulary for mapping repository results into API responses.

Sources: [1][8]

Before adoption

It does not connect to or operate a database by itself

Commons is shared interfaces and infrastructure, not a database engine or JDBC driver. Persisting and querying real data requires a module such as Spring Data JPA, MongoDB, or Redis plus the corresponding datastore configuration.

Sources: [1][5]

Align 4.0.7 with the supported Spring generation and Java baseline

The fixed 4.0.7 README requires JDK 17 or later for source builds and documents Maven 3.5 or later or the included wrapper. Before pinning Commons directly, verify compatibility with the Spring Data release train managed by the application's Spring Framework or Spring Boot version.

Sources: [1][2][3]

Official sources

  1. [1]Spring Data Commons 4.0.7 README(2026-10-04)
  2. [2]Spring Data Commons 4.0.7 release(2026-10-04)
  3. [3]Spring Data Commons 4.0.7 Maven metadata(2026-10-04)
  4. [4]Maven Compiler Plugin 3.14.1 release documentation(2026-10-04)
  5. [5]Spring Data project overview(2026-10-04)
  6. [6]Spring Data Commons 4.0.7 repository abstractions(2026-10-04)
  7. [7]Spring Data Commons 4.0.7 auditing reference(2026-10-04)
  8. [8]Spring Data Commons 4.0.7 Page API(2026-10-04)
  9. [9]Spring Data Commons 4.0.7 PageRequest API(2026-10-04)
Supplemental curator note

Evaluate this project as the shared contract beneath modules such as Spring Data JPA and MongoDB rather than as a database product. Applications normally choose the module for their datastore and consume Commons through that dependency.

Try it in 3 steps

  1. 1

    Create a minimal Java 17 Maven project

    With JDK 17 or later and Maven installed, create an evaluation project pinned to Spring Data Commons 4.0.7 and Maven Compiler Plugin 3.14.1 for the Java 17 release setting.

    mkdir spring-data-commons-demo && cd spring-data-commons-demo && printf '%s\n' '<project xmlns="http://maven.apache.org/POM/4.0.0"><modelVersion>4.0.0</modelVersion><groupId>example</groupId><artifactId>commons-demo</artifactId><version>1</version><properties><maven.compiler.release>17</maven.compiler.release></properties><dependencies><dependency><groupId>org.springframework.data</groupId><artifactId>spring-data-commons</artifactId><version>4.0.7</version></dependency></dependencies><build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.14.1</version></plugin></plugins></build></project>' > pom.xml
  2. 2

    Add a Page and Repository contract example

    Use a domain type, PagingAndSortingRepository, PageRequest, and Page together without inventing a database setup.

    mkdir -p src/main/java/example && printf '%s\n' 'package example;' 'import java.util.List;' 'import org.springframework.data.domain.*;' 'import org.springframework.data.repository.PagingAndSortingRepository;' 'record Person(Long id, String name) {}' 'interface People extends PagingAndSortingRepository<Person, Long> {}' 'public class Demo { public static void main(String[] args) { Pageable request = PageRequest.of(0, 2, Sort.by("name")); Page<Person> page = new PageImpl<>(List.of(new Person(1L, "Ada"), new Person(2L, "Grace")), request, 2); System.out.println(page.getContent()); System.out.println("pages=" + page.getTotalPages()); } }' > src/main/java/example/Demo.java
  3. 3

    Compile and inspect the page result

    Confirm the types compile against 4.0.7 and print two records and the total page count locally, without connecting to or writing a database.

    mvn -q compile dependency:build-classpath -Dmdep.outputFile=cp.txt && java -cp "target/classes:$(cat cp.txt)" example.Demo
Check the official README

Growth

Growth trends · Last 30 days

840 Stars

Trend data is still being collected.

Development activity

Last 90 days · weekly

Commits (last 30 days)
5
Open PRs
25

Development activity is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • spring-data
  • java
  • spring
  • ddd
  • framework
  • data-access
Stars
840
Forks
733
Watchers
86
Open issues
194
Contributors
187
Owner type
Organization
Primary language
Java
License
Apache-2.0
Repository last updated
Oct 2, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?