Skip to content

Commit 62c3820

Browse files
committed
docs: add docs about mapping types
1 parent 8f07338 commit 62c3820

3 files changed

Lines changed: 54 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Add `tarantool-spring-data-40` module with support for Spring Boot 4.0.x and Spring Data 4.0.x
88

9+
### Documentation
10+
11+
- Document supported Java types for Tarantool data mapping in `tuple_pojo_mapping` docs (RU/EN), including Tarantool extension types (`decimal`, `uuid`, `datetime`, `interval`, `tuple`) and related mapping notes.
12+
913
## [1.6.0] - 2026-04-01
1014

1115
### BOM Module

documentation/doc-src/pages/client/arch/tuple_pojo_mapping.en.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,31 @@ guide, but will help you understand the principles of interaction. Mastering the
2525
efficiently with the database in any scenarios, whether it's a cluster or a single instance, and with any POJO
2626
objects.
2727

28+
## Supported Java Types for Mapping
29+
30+
The SDK uses `Jackson + jackson-dataformat-msgpack`, so:
31+
32+
- standard Java/Jackson types (primitives and wrappers, `String`, `byte[]`, `List`, `Map`, nested POJOs)
33+
are supported by default;
34+
- Tarantool extension types are additionally supported.
35+
36+
Below are the types that have explicit Tarantool extension-type mapping in the SDK:
37+
38+
| Tarantool type | Java type | Comment |
39+
| --- | --- | --- |
40+
| `decimal` | `java.math.BigDecimal` | Uses MsgPack `decimal` extension; scale with absolute value up to and including `38` is supported. |
41+
| `uuid` | `java.util.UUID` | Uses MsgPack `uuid` extension. |
42+
| `datetime` | `java.time.Instant`, `java.time.LocalDateTime`, `java.time.LocalDate`, `java.time.LocalTime`, `java.time.OffsetDateTime`, `java.time.ZonedDateTime` | Uses MsgPack `datetime` extension. |
43+
| `interval` | `io.tarantool.mapping.Interval` | Uses MsgPack `interval` extension. |
44+
| `tuple` (Tarantool 3.x, `TUPLE_EXT`) | `io.tarantool.mapping.Tuple<T>` | Uses MsgPack `tuple` extension; useful when tuple format is returned with tuple data. |
45+
46+
???+ note "Note"
47+
48+
If you read data as `Object` (without an explicit target type), extension values are
49+
deserialized to SDK Java objects automatically:
50+
`decimal -> BigDecimal`, `uuid -> UUID`, `datetime -> ZonedDateTime`,
51+
`interval -> Interval`, `tuple -> Tuple<?>`.
52+
2853
## Efficient Mapping (Flatten input, Flatten output)
2954

3055
By default, field mapping in any of the clients (CrudClient, BoxClient) is performed in the most

documentation/doc-src/pages/client/arch/tuple_pojo_mapping.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ tarantool-java-sdk SDK есть модуль, который будет сери
2727
работать с базой данных в любых сценариях, будь то кластер или одиночный экземпляр, и с любыми POJO
2828
объектами.
2929

30+
## Поддерживаемые Java-типы при маппинге
31+
32+
SDK использует `Jackson + jackson-dataformat-msgpack`, поэтому:
33+
34+
- базовые типы Java/Jackson (примитивы и их обертки, `String`, `byte[]`, `List`, `Map`, вложенные POJO)
35+
поддерживаются по умолчанию;
36+
- дополнительно поддерживаются extension-типы Tarantool.
37+
38+
Ниже приведены типы, для которых в SDK есть явный маппинг из/в Tarantool extension types:
39+
40+
| Tarantool type | Java type | Комментарий |
41+
| --- | --- | --- |
42+
| `decimal` | `java.math.BigDecimal` | Используется MsgPack extension `decimal`; поддерживается scale по модулю до `38` включительно. |
43+
| `uuid` | `java.util.UUID` | Используется MsgPack extension `uuid`. |
44+
| `datetime` | `java.time.Instant`, `java.time.LocalDateTime`, `java.time.LocalDate`, `java.time.LocalTime`, `java.time.OffsetDateTime`, `java.time.ZonedDateTime` | Используется MsgPack extension `datetime`. |
45+
| `interval` | `io.tarantool.mapping.Interval` | Используется MsgPack extension `interval`. |
46+
| `tuple` (Tarantool 3.x, `TUPLE_EXT`) | `io.tarantool.mapping.Tuple<T>` | Используется MsgPack extension `tuple`; полезно, когда вместе с данными приходит формат кортежа. |
47+
48+
???+ note "Заметка"
49+
50+
Если вы читаете данные как `Object` (без явного целевого класса), extension-типы будут
51+
десериализованы в Java-объекты SDK автоматически:
52+
`decimal -> BigDecimal`, `uuid -> UUID`, `datetime -> ZonedDateTime`,
53+
`interval -> Interval`, `tuple -> Tuple<?>`.
54+
3055
## Эффективный Маппинг (Flatten input, Flatten output)
3156

3257
По умолчанию маппинг полей в любом из клиентов(CrudClient, BoxClient), выполняется наиболее

0 commit comments

Comments
 (0)