-
Notifications
You must be signed in to change notification settings - Fork 974
DDBEnhanced - Support to flatten a Map into top level attributes of the object #6102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDBEnhanced - Support to flatten a Map into top level attributes of the object #6102
Conversation
25598b0 to
fab983f
Compare
fab983f to
b0979f4
Compare
.changes/next-release/feature-AmazonDynamoDBEnhancedClient-22723fc.json
Outdated
Show resolved
Hide resolved
...rc/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchema.java
Outdated
Show resolved
Hide resolved
...d/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenMapTest.java
Show resolved
Hide resolved
...-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/BeanTableSchema.java
Outdated
Show resolved
Hide resolved
...tom/dynamodb-enhanced/src/it/java/software/amazon/awssdk/enhanced/dynamodb/model/Record.java
Show resolved
Hide resolved
e438149 to
247d722
Compare
|
Hello @alextwoods, Thank you very much for your feedback, we have addressed the comments from the pull request. After further analysis, we changed from the original proposal of separate annotations to a unified @DynamoDbFlatten approach that handles both objects and maps. We chose this design for better API consistency. You can find the updated Solution Proposal here. Could you please review this approach and provide your feedback? |
|
It looks like checkstyle is failing - make sure you run checkstyle locally. |
...it/java/software/amazon/awssdk/enhanced/dynamodb/ScanQueryWithFlattenMapIntegrationTest.java
Outdated
Show resolved
Hide resolved
...rc/it/java/software/amazon/awssdk/enhanced/dynamodb/DynamoDbEnhancedIntegrationTestBase.java
Outdated
Show resolved
Hide resolved
...c/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/annotations/DynamoDbFlatten.java
Outdated
Show resolved
Hide resolved
...rc/main/java/software/amazon/awssdk/enhanced/dynamodb/mapper/StaticImmutableTableSchema.java
Outdated
Show resolved
Hide resolved
...d/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenMapTest.java
Show resolved
Hide resolved
...d/src/test/java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/FlattenMapTest.java
Show resolved
Hide resolved
19768ac to
6389bd2
Compare
0ce264a to
c2a145b
Compare
|
Hello @alextwoods, Thank you very much for the review! I have addressed the comments raised and resolved the checkstyle issues. |
|




Added the facility of using an annotation that will flatten a map of attributes in a class,
similar to what @DynamoDbFlatten does for attributes from another class.
Description
Added a new annotation named DynamoDbFlattenMap that can be applied at method level for only a single map of attributes within a class (Map<String, String>). If used on multiple maps of attributes, the serialization will throw an exception.
Motivation and Context
#2542
Modifications
Followed the same approach as for DybamoDbFlatten annotation, that is used to flatten all the attributes of a separate DynamoDb bean that is stored in the current bean
Testing
The changes have already been tested by running the existing tests and also added new unit/integration tests for the new flow.
Test Coverage Checklist
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsscripts/new-changescript and following the instructions. Commit the new file created by the script in.changes/next-releasewith your changes.License