Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ tarantool-java-sdk (parent POM)
├── tarantool-spring-data-core
├── tarantool-spring-data-27
├── ...
├── tarantool-spring-data-34
├── tarantool-spring-data-35
├── testcontainers
└── jacoco-coverage-aggregate-report
```
Expand Down
8 changes: 4 additions & 4 deletions documentation/docs/documentation/spring-data/index.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ using [Tarantool](https://www.tarantool.io) as a data store.

## Project Status

| tarantool-java-sdk Version | tarantool-spring-data Version | Spring Boot Version |
|:-------------------------:|:----------------------------:|:-----------------------------------------:|
| 1.5.x | 1.5.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 |
| tarantool-java-sdk Version | tarantool-spring-data Version | Spring Boot Version |
|:-------------------------:|:----------------------------:|:-------------------------------------------------:|
| 1.5.x | 1.5.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 / 3.5.7 |

### Tarantool Version and Supported Client Modules

Expand Down Expand Up @@ -88,7 +88,7 @@ Include the module in your project as follows:
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-34</artifactId>
<artifactId>tarantool-spring-data-35</artifactId>
<version>${tarantool-spring-data.version}</version>
</dependency>
</dependencies>
Expand Down
10 changes: 5 additions & 5 deletions documentation/docs/documentation/spring-data/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ hide:

## Статус проекта

| Версия tarantool-java-sdk | Версия tarantool-spring-data | Версия Spring Boot |
|:-------------------------:|:----------------------------:|:-----------------------------------------:|
| 1.5.x | 1.5.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 |
| Версия tarantool-java-sdk | Версия tarantool-spring-data | Версия Spring Boot |
|:-------------------------:|:----------------------------:|:-------------------------------------------------:|
| 1.5.x | 1.5.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 / 3.5.7 |

### Версия Tarantool и поддерживаемые модули-клиенты

Expand Down Expand Up @@ -84,11 +84,11 @@ Tarantool можно найти
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>3.4.12</version>
<version>3.5.7</version>
</dependency>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-34</artifactId>
<artifactId>tarantool-spring-data-35</artifactId>
<version>${tarantool-spring-data.version}</version>
</dependency>
</dependencies>
Expand Down
15 changes: 8 additions & 7 deletions tarantool-spring-data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ data storage.

## Project Status

| tarantool-java-sdk Version | tarantool-spring-data Version | Spring Boot Version |
|:--------------------------:|:-----------------------------:|:------------------------------------------:|
| 1.0.0 | 1.0.0 | 2.7.18 |
| 1.1.x | 1.1.x | 2.7.18 / 3.1.10 / 3.2.4 |
| 1.2.x | 1.2.x | 2.7.18 / 3.1.10 / 3.2.4 |
| 1.3.x | 1.3.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.11 / 3.4.5 |
| 1.4.x | 1.4.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 |
| tarantool-java-sdk Version | tarantool-spring-data Version | Spring Boot Version |
|:--------------------------:|:-----------------------------:|:-------------------------------------------------:|
| 1.0.0 | 1.0.0 | 2.7.18 |
| 1.1.x | 1.1.x | 2.7.18 / 3.1.10 / 3.2.4 |
| 1.2.x | 1.2.x | 2.7.18 / 3.1.10 / 3.2.4 |
| 1.3.x | 1.3.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.11 / 3.4.5 |
| 1.4.x | 1.4.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 |
| 1.5.x | 1.5.x | 2.7.18 / 3.1.10 / 3.2.4 / 3.3.13 / 3.4.10 / 3.5.7 |

### Tarantool Version and Supported Client Modules

Expand Down
1 change: 1 addition & 0 deletions tarantool-spring-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<module>tarantool-spring-data-32</module>
<module>tarantool-spring-data-33</module>
<module>tarantool-spring-data-34</module>
<module>tarantool-spring-data-35</module>
</modules>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.tarantool.spring.data27.config.properties.TarantoolProperties;

@Testcontainers
@Timeout(20)
@Timeout(60)
public abstract class BaseIntegrationTest {

protected static TarantoolContainerOperations<?> clusterContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.tarantool.spring.data31.config.properties.TarantoolProperties;

@Testcontainers
@Timeout(20)
@Timeout(60)
public abstract class BaseIntegrationTest {

protected static TarantoolContainerOperations<?> clusterContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.tarantool.spring.data32.config.properties.TarantoolProperties;

@Testcontainers
@Timeout(20)
@Timeout(60)
public abstract class BaseIntegrationTest {

protected static TarantoolContainerOperations<?> clusterContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.tarantool.spring.data33.config.properties.TarantoolProperties;

@Testcontainers
@Timeout(20)
@Timeout(60)
public abstract class BaseIntegrationTest {

protected static TarantoolContainerOperations<?> clusterContainer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import io.tarantool.spring.data34.config.properties.TarantoolProperties;

@Testcontainers
@Timeout(20)
@Timeout(60)
public abstract class BaseIntegrationTest {

protected static TarantoolContainerOperations<?> clusterContainer;
Expand Down
45 changes: 45 additions & 0 deletions tarantool-spring-data/tarantool-spring-data-35/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>tarantool-spring-data-35</name>
<description>Minimalistic java connector for Tarantool versions 2.11+ based on Netty framework</description>
<url>https://tarantool.io</url>

<parent>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<artifactId>tarantool-spring-data-35</artifactId>
<version>2.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<properties>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<spring.boot.version>3.5.7</spring.boot.version>
<shared.dir>${project.parent.parent.basedir}/tarantool-shared-resources/</shared.dir>
<license.header.file>${project.parent.parent.basedir}/LICENSE_HEADER.txt</license.header.file>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>${spring.boot.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>io.tarantool</groupId>
<artifactId>tarantool-spring-data-core</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY
* All Rights Reserved.
*/

package io.tarantool.spring.data35;

import java.util.Map;

import org.springframework.data.keyvalue.core.AbstractKeyValueAdapter;
import org.springframework.data.util.CloseableIterator;
import org.springframework.lang.NonNull;

import io.tarantool.client.box.TarantoolBoxClient;
import io.tarantool.spring.data.ProxyTarantoolBoxKeyValueAdapter;

public class TarantoolBoxKeyValueAdapter extends AbstractKeyValueAdapter {

private final ProxyTarantoolBoxKeyValueAdapter adapter;

public TarantoolBoxKeyValueAdapter(@NonNull TarantoolBoxClient tarantoolBoxClient) {
adapter = new ProxyTarantoolBoxKeyValueAdapter(tarantoolBoxClient);
}

@Override
public Object put(Object id, Object item, String keyspace) {
return adapter.put(id, item, keyspace);
}

@Override
public boolean contains(Object id, String keyspace) {
return adapter.contains(id, keyspace);
}

@Override
public Object get(Object id, String keyspace) {
return adapter.get(id, keyspace);
}

@Override
public Object delete(Object id, String keyspace) {
return adapter.delete(id, keyspace);
}

@Override
public Iterable<?> getAllOf(String keyspace) {
return adapter.getAllOf(keyspace);
}

@Override
public void deleteAllOf(String keyspace) {
adapter.deleteAllOf(keyspace);
}

@Override
public void clear() {
adapter.clear();
}

@Override
public long count(String keyspace) {
return adapter.count(keyspace);
}

@Override
public void destroy() throws Exception {
adapter.destroy();
}

@Override
public CloseableIterator<Map.Entry<Object, Object>> entries(String keyspace) {
throw new UnsupportedOperationException("Not implemented yet");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
/*
* Copyright (c) 2025 VK DIGITAL TECHNOLOGIES LIMITED LIABILITY COMPANY
* All Rights Reserved.
*/

package io.tarantool.spring.data35;

import java.util.Collections;
import java.util.Map.Entry;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.data.keyvalue.core.AbstractKeyValueAdapter;
import org.springframework.data.util.CloseableIterator;
import org.springframework.lang.NonNull;

import io.tarantool.client.crud.TarantoolCrudClient;
import io.tarantool.spring.data.ProxyTarantoolCrudKeyValueAdapter;
import io.tarantool.spring.data.mapping.model.CompositeKey;

public class TarantoolCrudKeyValueAdapter extends AbstractKeyValueAdapter {

private final ProxyTarantoolCrudKeyValueAdapter adapter;

public TarantoolCrudKeyValueAdapter(@NonNull TarantoolCrudClient client) {
super(new TarantoolQueryEngine(client));
this.adapter = new ProxyTarantoolCrudKeyValueAdapter(client);
}

@Override
public Object put(Object id, Object item, String keyspace) {
return adapter.put(convertId(id), item, keyspace);
}

@Override
public boolean contains(Object id, String keyspace) {
return adapter.contains(convertId(id), keyspace);
}

@Override
public Object get(Object id, String keyspace) {
return adapter.get(convertId(id), keyspace);
}

@Override
public <T> T get(Object id, String keyspace, Class<T> type) {
return adapter.get(convertId(id), keyspace, type);
}

@Override
public Object delete(Object id, String keyspace) {
return adapter.delete(convertId(id), keyspace);
}

@Override
public <T> T delete(Object id, String keyspace, Class<T> type) {
return adapter.delete(convertId(id), keyspace, type);
}

@Override
public Iterable<?> getAllOf(String keyspace) {
return adapter.getAllOf(keyspace);
}

@Override
public void deleteAllOf(String keyspace) {
adapter.deleteAllOf(keyspace);
}

@Override
public void clear() {
adapter.clear();
}

@Override
public void destroy() throws Exception {
adapter.destroy();
}

@Override
public long count(String keyspace) {
return adapter.count(keyspace);
}

@Override
public CloseableIterator<Entry<Object, Object>> entries(String keyspace) {
throw new UnsupportedOperationException("Not implemented yet");
}

/**
* Convert the identifier to the form required by the tarantool-java-sdk driver.
*
* @param id identifier object
* @return identifier in the required form
*/
private Object convertId(Object id) {
if (id instanceof CompositeKey || hasJsonFormatArrayAnnotation(id)) {
return id;
}
return Collections.singletonList(id);
}

/**
* Determine whether the identifier type is annotated with the {@link JsonFormat} annotation.
*
* @param id identifier object
* @return return true if the annotation is present, false otherwise
*/
private boolean hasJsonFormatArrayAnnotation(Object id) {
final JsonFormat jsonFormatAnnotation =
AnnotatedElementUtils.findMergedAnnotation(id.getClass(), JsonFormat.class);

return jsonFormatAnnotation != null
&& JsonFormat.Shape.ARRAY.equals(jsonFormatAnnotation.shape());
}
}
Loading
Loading