https://github.com/spring-projects/spring-data-keyvalue
Project to provide infrastructure to implement Spring Data repositories on top of key-value-based, in-memory data stores.
https://github.com/spring-projects/spring-data-keyvalue
Last synced: 15 days ago
JSON representation
Project to provide infrastructure to implement Spring Data repositories on top of key-value-based, in-memory data stores.
- Host: GitHub
- URL: https://github.com/spring-projects/spring-data-keyvalue
- Owner: spring-projects
- License: apache-2.0
- Created: 2014-11-27T11:48:38.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2025-03-14T08:33:47.000Z (12 months ago)
- Last Synced: 2025-04-04T01:07:54.282Z (11 months ago)
- Language: Java
- Homepage: http://projects.spring.io/spring-data
- Size: 2.61 MB
- Stars: 148
- Watchers: 18
- Forks: 76
- Open Issues: 18
-
Metadata Files:
- Readme: README.adoc
- Contributing: CONTRIBUTING.adoc
- License: LICENSE.txt
- Security: SECURITY.adoc
Awesome Lists containing this project
README
= Spring Data KeyValue 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 KeyValue"]
The primary goal of the https://projects.spring.io/spring-data[Spring Data] project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
This module provides infrastructure components to build repository abstractions for stores dealing with Key/Value pairs and ships with a default `java.util.Map` based implementation.
== Features
* Infrastructure for building repositories on top of key/value implementations.
* Dynamic SpEL query generation from query method names.
* Possibility to integrate custom repository code.
include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/code-of-conduct.adoc[]
== Getting Started
Here is a quick teaser of an application using Spring Data Repositories in Java:
[source,java]
----
public interface PersonRepository extends CrudRepository {
List findByLastname(String lastname);
List findByFirstnameLike(String firstname);
}
@Service
public class MyService {
private final PersonRepository repository;
public MyService(PersonRepository repository) {
this.repository = repository;
}
public void doWork() {
repository.deleteAll();
Person person = new Person();
person.setFirstname("Oliver");
person.setLastname("Gierke");
repository.save(person);
List lastNameResults = repository.findByLastname("Gierke");
List firstNameResults = repository.findByFirstnameLike("Oli*");
}
}
@KeySpace("person")
class Person {
@Id String uuid;
String firstname;
String lastname;
// getters and setters omitted for brevity
}
@Configuration
@EnableMapRepositories("com.acme.repositories")
class AppConfig { … }
----
include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/dependencies.adoc[]
include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/getting-help.adoc[]
include::https://raw.githubusercontent.com/spring-projects/spring-data-build/refs/heads/main/etc/readme/license.adoc[]