Added support for @DynamoDbUpdateBehavior on attributes within nested objects#6708
Open
anasatirbasa wants to merge 8 commits intoaws:masterfrom
Conversation
4c585a0 to
6f6f15b
Compare
6f6f15b to
3e5c890
Compare
...ftware/amazon/awssdk/enhanced/dynamodb/extensions/AutoGeneratedTimestampRecordExtension.java
Show resolved
Hide resolved
...ftware/amazon/awssdk/enhanced/dynamodb/extensions/AutoGeneratedTimestampRecordExtension.java
Show resolved
Hide resolved
.../software/amazon/awssdk/enhanced/dynamodb/internal/extensions/utility/NestedRecordUtils.java
Outdated
Show resolved
Hide resolved
.../software/amazon/awssdk/enhanced/dynamodb/internal/extensions/utility/NestedRecordUtils.java
Outdated
Show resolved
Hide resolved
.../software/amazon/awssdk/enhanced/dynamodb/internal/extensions/utility/NestedRecordUtils.java
Show resolved
Hide resolved
...ftware/amazon/awssdk/enhanced/dynamodb/extensions/AutoGeneratedTimestampRecordExtension.java
Outdated
Show resolved
Hide resolved
...ain/java/software/amazon/awssdk/enhanced/dynamodb/internal/update/UpdateExpressionUtils.java
Show resolved
Hide resolved
...ced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/EnhancedClientUtils.java
Outdated
Show resolved
Hide resolved
...oftware/amazon/awssdk/enhanced/dynamodb/functionaltests/models/UpdateBehaviorTestModels.java
Outdated
Show resolved
Hide resolved
.../java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/NestedUpdateBehaviorTest.java
Outdated
Show resolved
Hide resolved
.../java/software/amazon/awssdk/enhanced/dynamodb/functionaltests/NestedUpdateBehaviorTest.java
Outdated
Show resolved
Hide resolved
…nnotations-in-nested-objects
…nnotations-in-nested-objects
…nnotations-in-nested-objects
amzn-erdemkemer
approved these changes
Feb 18, 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.
Description
Added support for @DynamoDbUpdateBehavior on attributes within nested objects. The @DynamoDbUpdateBehavior annotation will only take effect for nested attributes when using IgnoreNullsMode.SCALAR_ONLY.
Motivation and Context
@DynamoDbUpdateBehavior to work on nested objects too.
Modifications
Support for
@DynamoDbUpdateBehavioron nested attributes was implemented by accounting for the two possible representations of nested objects during update operations:IgnoreNullsMode.IgnoreNullsMode.SCALAR_ONLYis used, nested attributes are flattened using the internal_NESTED_ATTR_UPDATE_marker. This behavior is handled inUpdateItemOperation.transformItemToMapForUpdateExpression.Both scenarios are now supported, and the same generated timestamp is applied consistently across both top-level and nested attributes.
In parallel, the evaluation of the
IgnoreNullsModeparameter within update requests was reviewed and refined. As part of this change:UpdateExpressionUtilsnow evaluates the@DynamoDbUpdateBehaviorannotation only whenIgnoreNullsMode.SCALAR_ONLYis configured._NESTED_ATTR_UPDATE_marker.@DynamoDbUpdateBehaviorto lists of nested objects is explicitly not supported, as DynamoDB update operations replace the entire list and do not allow updates to individual list elements.Testing
Existing test coverage was updated where necessary, and additional tests were introduced to validate the new behavior across nested object scenarios and different
IgnoreNullsModeconfigurations.Test Coverage on modified classes:
Test Coverage Checklist
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