项目 / spring-projects/spring-data-examples

spring-projects/spring-data-examples

行业推荐
语言 Java标签 —数据更新 2026-11-25 06:49:28 · 仓库 2026-11-21

一段话介绍

Spring Data Example Projects

本站整理,非 GitHub 官方 description。

官方 description(GitHub API 原样)
Spring Data Example Projects
5,429累计星
3,392Fork
—峰值日增
0上榜次数
总榜
暂未入榜
日榜
暂未入榜
周榜
暂未入榜
月榜
暂未入榜

官方快照(gh_history.db,2026-11-25):总榜 未进 Top50 · 日榜 未进 Top50 · 周榜未满 7 天基线(官方不生成) · 月榜暂无官方口径;下方四卡为站内趋势聚合(周卡按上榜次数,非官方 7 日增量窗)。

行业与场景

按行业选型 →

智能题库与自动阅卷

适配系统:考试系统、题库系统 · 得分 1.3

提供组卷、作答与自动评分链路,可嵌入考试系统降低教师批改成本。

更多信息

以下三段按该项目自己的 GitHub README 章节摘录(可合理截断并标明);README 没有对应章节的留空,不编造。

我的用法
打开[仓库说明](https://github.com/spring-projects/spring-data-examples),按 Cassandra、JPA、MongoDB 等模块目录进入相应示例。源文写明需使用 Java 16 或更新版本,并建议为 IDE 安装 Lombok 插件。多数存储示例会用 Testcontainers 或内嵌数据库启动。
特点或设计要点
示例按 Spring Data 各模块分目录存放,覆盖 Apache Cassandra、Elasticsearch、JDBC、JPA、LDAP、MongoDB、Neo4j、R2DBC、Redis、REST 和 Web 支持等。实际说明文件名为 README.adoc。
星标走势还差一天的数据,明天就能看到曲线
每天 10:30 记一次星标,连续两天后自动生成曲线
首次发现 — · 最近在榜 2026-08-03 · 语言 Java · 贡献者 —
java

GitHub 项目主页介绍

来自 GitHub 仓库 README / 主页介绍正文,原样摘录,共 8,407 字节。

= Spring Data Examples image:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A["Revved up by Develocity", link="https://ge.spring.io/scans?search.rootProjectNames=Spring Data - Examples"]

image:https://travis-ci.org/spring-projects/spring-data-examples.svg?branch=main[Build Status,link=https://travis-ci.org/spring-projects/spring-data-examples]

This repository contains example projects for the different Spring Data modules to showcase the API and how to use the features provided by the modules.

We have separate folders for the samples of individual modules:

== Spring Data for Apache Cassandra

* `aot-optimization` - Use Ahead-Of-Time Repositories with Spring Data for Apache Cassandra.
* `example` - Shows core Spring Data support for Apache Cassandra.
* `kotlin` - Example for using Cassandra with Kotlin.
* `reactive` - Example project to show reactive template and repository support.
* `vector-search` - Example how to do vector search with a Spring Data Cassandra repository.

== Spring Data Elasticsearch

* `example` - Example how to use basic text search, geo-spatial search and facets. It uses
 the High Level REST Client backing template and repository.
* `reactive` - Example how to use reactive client, template and repository features.

Local Elasticsearch instance must be running to run the tests.

== Spring Data JDBC

* `aot-optimization` - Use Ahead-Of-Time Repositories with Spring Data JDBC.
* `basic` - Basic usage of Spring Data JDBC.
* `graalvm-native` - This example compiles a basic Spring Data JDBC application into a GraalVM native image.
* `howto` - A collection of projects to go with the https://spring.io/blog/2021/09/09/spring-data-jdbc-how-to-use-custom-id-generation[Spring Data JDBC - How to blog posts].
* `immutables` - Showing Spring Data JDBC usage
 with https://immutables.github.io/[Immutables]
* `jmolecules` - Demonstrates the interaction of jMolecules with Spring Data JDBC.
* `jooq` - Demonstrates how to use jOOQ and Spring Data JDBC together.
* `mybatis` - Demonstrate how to use MyBatis to generate SQL for Spring Data JDBC.
* `singlequeryloading` - Demonstrates how to enable Single Query Loading.

== Spring Data JPA

* `aot-optimization` - Use Ahead-Of-Time Repositories with Spring Data JPA.
* `eclipselink` - Sample project to show how to use Spring Data JPA with Spring Boot and https://www.eclipse.org/eclipselink/[Eclipselink].
* `example` - Probably the project you want to have a look at first.
Contains a variety of sample packages, showcasing the different levels at which you can use Spring Data JPA.
Have a look at the `simple` package for the most basic setup.
Contains also examples running on Virtual Threads.
* `interceptors` - Example of how to enrich the repositories with AOP.
* `jpa21` - Shows support for JPA 2.1 specific features (stored procedures support).
* `multiple-datasources` - Examples of how to use Spring Data JPA with multiple `DataSource`s.
* `query-by-example` - Example project showing usage of Query by Example with Spring Data JPA.
* `security` - Example of how to integrate Spring Data JPA Repositories with Spring Security.
* `showcase` - Refactoring show case of how to improve a plain-JPA-based persistence layer by using Spring Data JPA (read: removing close to all of the implementation code).Follow the `demo.txt` file for detailed instructions.
* `vavr` - Shows the support of https://www.vavr.io[Vavr] collection types as return types for query methods.
* `vector-search` - Example how to do vector search with a Spring Data JPA repository and `hibernate-vector`.

== Spring Data LDAP

* `example` - Sample for Spring Data repositories to access an LDAP store.

== Spring Data MongoDB

* `aot-optimization` - Use Ahead-Of-Time Repositories with Spring Data MongoDB.
* `aggregation` - Example project to showcase the MongoDB aggregation framework support.
* `example` - Example project for general repository functionality (including geo-spatial functionality), Querydsl integration, bulk write and other advanced topics.
* `fluent-api` - Example project to show the new fluent API (`MongoTemplate`-alternative) to interact with MongoDB.
* `geo-json` - Example project showing usage of http://geojson.org[GeoJSON] with MongoDB.
* `gridfs` - Example project showing usage of gridFS with MongoDB.
* `jmolecules` - Example of Spring Data MongoDB working with a jMolecules based domain model.
* `kotlin` - Example for using https://kotlinlang.org/[Kotlin] with MongoDB.
* `linking` - Example demonstrating possibilities for linking documents.
* `query-by-example` - Example project showing usage of Query by Example with MongoDB.
* `querydsl` - Example project showing imperative and reactive https://github.com/querydsl/querydsl[Querydsl] support for MongoDB.
* `reactive` - Example project to show reactive template and repository support.
* `repository-metrics` - Example project to show how to collect repository method invocation metrics.
* `security` - Example project showing usage of Spring Security with MongoDB.
* `text-search` - Example project showing usage of MongoDB text search feature.
* `transactions` - Example project for imperative and reactive MongoDB 4.0 transaction support.
* `vector-search` - Example how to do vector search with a Spring Data MongoDB repository.

== Spring Data Neo4j

* `example` - Example to show basic node and relationship entities and repository usage.

== Spring Data R2DBC

* `example` - Basic usage of Spring Data R2DBC.

== Spring Data Redis

* `cluster` - Example for Redis Cluster support.
* `example` - Example for basic Spring Data Redis setup.
* `listener` - Example to show declarative `@RedisListener` Pub/Sub.
* `pubsub` - Example project to show programmatic Pub/Sub usage using Platform and Virtual Threads.
* `reactive` - Example project to show reactive template support.
* `repositories` - Example demonstrating Spring Data repository abstraction on top of Redis.
* `sentinel` - Example for Redis Sentinel support.
* `streams` - Example for https://redis.io/topics/streams-intro[Redis Streams] support.

Local Redis instances must be running to run the tests. One option is to use Docker in a separate terminal:

```
$ docker run -p 6379:6379 redis:5.0
```

WARNING: If you're done using it, don't forget to shut it down!

== Spring Data REST

* `headers` - A sample showing the population of HTTP headers and the usage of them to perform conditional `GET` requests.
* `multi-store` - A sample REST web-service based on both Spring Data JPA and Spring Data MongoDB.
* `projections` - A sample REST web-service showing how to use projections.
* `security` - A sample REST web-service secured using Spring Security.
* `starbucks` - A sample REST web-service built with Spring Data REST and MongoDB.
* `uri-customizations` - Example project to show URI customization capabilities.

== Spring Data web support

* `projections` - Example for Spring Data web support for JSONPath and XPath expressions on projection interfaces.
* `querydsl` - Example for Spring Data Querydsl web integration (creating a `Predicate` from web requests).
* `web` - Example for Spring Data web integration (binding `Pageable` instances to Spring MVC controller methods, using interfaces to bind Spring MVC request payloads).

== Miscellaneous

* `jdbc/typed-property-path` - Example project to demonstrate usage of `TypedPropertyPath` for refactoring safe queries and sort.
* `mongodb/fragment-spi` - Example project how to use Spring Data Fragment SPI to provide reusable custom extensions.
* `bom` - Example project how to use the Spring Data release train bom in non-Spring-Boot scenarios.
* `map` - Example project to show how to use `Map`-backed repositories.
* `multi-store` - Example project to use both Spring Data MongoDB and Spring Data JPA in
 one project.

== Note

* The example projects make use of the https://projectlombok.org/[Lombok] plugin. To get
 proper code navigation in your IDE, you must install it separately. Lombok is available
 in the IntelliJ plugins repository and as
 a https://projectlombok.org/download[download] for Eclipse-based IDEs.
* The code makes use of Java 16 language features therefore you need Java 16 or newer to
 run and compile the examples.
* Most store modules examples start their database via Testcontainers or as
 embedded/in-memory server unless stated otherwise.
↑