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.
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.
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.
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.
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.
Official sources
- [1]Spring Data Commons 4.0.7 README(2026-10-04)
- [2]Spring Data Commons 4.0.7 release(2026-10-04)
- [3]Spring Data Commons 4.0.7 Maven metadata(2026-10-04)
- [4]Maven Compiler Plugin 3.14.1 release documentation(2026-10-04)
- [5]Spring Data project overview(2026-10-04)
- [6]Spring Data Commons 4.0.7 repository abstractions(2026-10-04)
- [7]Spring Data Commons 4.0.7 auditing reference(2026-10-04)
- [8]Spring Data Commons 4.0.7 Page API(2026-10-04)
- [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
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
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
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
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
Categories
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
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Spring Batch2,962 Stars
2 shared tag(s) · 1 shared category(s) · Same language
structure large data workloads with Jobs, Steps, chunks, and tasklets
Java - APITable15,629 Stars
2 shared tag(s)
combine a spreadsheet-style data layer with APIs, embedding, and automation for low-code applications
TypeScript - RxJava48,185 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Compose asynchronous and event-driven JVM programs with typed streams and operators
Java - Netty35,064 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Build high-connection protocol servers and clients in Java from event loops and channel pipelines
Java - Apache Kafka33,900 Stars
1 shared tag(s) · 1 shared category(s) · Same language
Store durable events in topics and partitions and build distributed pipelines with producers, consumers, Streams, and Connect
Java - Kestra29,100 Stars
1 shared tag(s) · 1 shared category(s) · Same language
orchestrate data, AI, and infrastructure workflows with one declarative model
Java
Report incorrect information
Tell us if any listing information is incorrect or outdated.