An open API service indexing awesome lists of open source software.

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.

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[]