Repository navigation
DynamoDB Enhanced Client README: store a list of objects in an item - #7458
Merged
Merged
Conversation
Add a "Store a list of objects inside an item" section that shows how to save a List of beans as a DynamoDB list of maps, with annotations (@DynamoDbBean) and with a StaticTableSchema (EnhancedType.listOf(EnhancedType.documentOf(...))). The README previously only showed flattening. Fixes aws#2265
Closed
kdaily
reviewed
Oct 19, 2026
kdaily
reviewed
Oct 19, 2026
kdaily
reviewed
Oct 19, 2026
Co-authored-by: Kenneth Daily <kdaily@amazon.com>
alextwoods
self-requested a review
October 22, 2026 21:57
alextwoods
approved these changes
Oct 22, 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.
Motivation and Context
Fixes #2265.
Customer wanted to save a
Listof their own objects inside an item as a list of maps, not flattened. The DynamoDB Enhanced Client README only shows flattening ("Flat map attributes from another class"), so they couldn't find how to do it. The two working approaches from the issue thread weren't documented in the README.Modifications
services-custom/dynamodb-enhanced/README.md: new section "Store a list of objects inside an item", placed before "Flat map attributes from another class". It shows:@DynamoDbBeanon both classes,TableSchema.fromBean(...)),EnhancedType.listOf(EnhancedType.documentOf(...))),addAttribute(List.class, ...)fails withIndexOutOfBoundsException, the error from the issue,No code changes.
Testing
Documentation-only change. The code in the new section was run exactly as written:
recordMetadata = L:[ M:{id, details}, M:{id, details} ]and reads back correctly.addAttribute(List.class, ...): building the schema fails withjava.lang.IndexOutOfBoundsException: Index: 0(DefaultAttributeConverterProvider.findConverterreads the list element type withrawClassParameters().get(0), and a rawList.classhas none).javac -Xlint:allwith no warnings. To compile, each class was put in its own file with apackageline, and the two static schema fields were put inside a class.@DynamoDbImmutableclasses, other SDK versions.https://github.com/adev-code/aws-sdk-java-v2/blob/gh-2265-readme-list-of-objects/services-custom/dynamodb-enhanced/README.md#store-a-list-of-objects-inside-an-item
License