feat(mapping): TupleMapper utility and CRUD metadata support#62
Merged
feat(mapping): TupleMapper utility and CRUD metadata support#62
Conversation
a8b108a to
3af6a03
Compare
- Add TupleMapper utility class for easy tuple-to-POJO mapping using field format - Update CRUD operations (select, insert, get) to propagate format metadata from CrudResponse - Add getFormats() overload with CRUD metadata fallback - Add integration tests for select, insert, get with format metadata - Add test for fields filtering with GetOptions - Update TarantoolBoxClientTest to use TupleMapper instead of manual IntStream mapping Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3af6a03 to
03fb07c
Compare
Alex-pvl
reviewed
Mar 31, 2026
| if (!formats.isEmpty()) { | ||
| for (Tuple<?> tuple : resp.get()) { | ||
| Integer formatId = tuple.getFormatId(); | ||
| List<Field> format = formats.get(formatId); |
Contributor
There was a problem hiding this comment.
Тут и в других методах не нужен fallback?
if (formatId == null && formats.size() == 1) {
format = formats.values().stream().findFirst().get();
}
Contributor
Author
There was a problem hiding this comment.
Хм, возможно стоит добавить
Contributor
Author
There was a problem hiding this comment.
Ага, вроде везде добавил
Add fallback logic to injectFormatIntoTuples, getTuplesWithInjectedFormat, and getBatchTuplesWithInjectedFormat methods. When formatId is null and only one format is available, use that format instead of null. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
bdfcf7c to
7bb23bc
Compare
Alex-pvl
approved these changes
Mar 31, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds syntactic sugar for key-based tuple-to-POJO mapping by:
TupleMapper utility class - Provides static methods for easy mapping:
toMap(tuple, format)- Convert tuple to Map using field namesmapToPojo(tuple, format, targetClass)- Map tuple to POJOmapToPojo(tuple, targetClass)- Map tuple with embedded format to POJOmapToPojoList(tuples, format, targetClass)- Map list of tuplesCRUD metadata propagation - Updated CRUD operations to pass format metadata:
select,insert,getnow propagate format fromCrudResponse.metadatagetFormats(response, crudMetadata)overload with fallback logicIntegration tests - Added tests for:
testSelectWithFormatFromCrudMetadatatestInsertAndGetWithFormatFromCrudMetadatatestGetWithFieldsFilterAndFormat(usingGetOptions.withFields())Test plan
🤖 Generated with Claude Code