Skip to content

Commit d5c59ef

Browse files
committed
DynamoDb enhanced client: support UpdateExpressions in single-request update
1 parent 48d8ad9 commit d5c59ef

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/operations/UpdateItemOperation.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ public TransactWriteItem generateTransactWriteItem(TableSchema<T> tableSchema, O
270270
}
271271

272272
/**
273-
* Merges UpdateExpressions from POJO attributes, extensions, and request with priority-based resolution.
274-
* Attributes referenced in extension expressions are excluded from REMOVE actions to prevent conflicts.
273+
* Merges UpdateExpressions from three sources in priority order: POJO attributes (lowest),
274+
* extensions (medium), request (highest). Higher priority sources override conflicting actions.
275+
*
276+
* <p>Null POJO attributes normally generate REMOVE actions, but are skipped if the same
277+
* attribute is referenced in extension/request expressions to avoid DynamoDB conflicts.
275278
*
276279
* @param tableMetadata metadata about the table structure
277280
* @param transformation write modification from extensions containing UpdateExpression

services-custom/dynamodb-enhanced/src/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/update/UpdateExpressionResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public static Builder builder() {
5656
* Merges UpdateExpressions from three sources with priority: item attributes (lowest),
5757
* extension expressions (medium), request expressions (highest).
5858
*
59-
* <p><b>Steps:</b> Find attributes in expressions to exclude from removalgenerate item SET/REMOVE actions
60-
* → merge with extension expressions → merge with request expressions.
59+
* <p><b>Steps:</b> Identify attributes used by extensions/requests to prevent REMOVE conflicts
60+
* create item SET/REMOVE actions → merge extensions (override item) → merge request (override all).
6161
*
6262
* <p><b>Backward compatibility:</b> Without request expressions, behavior is identical to previous versions.
6363
* <p><b>Exceptions:</b> DynamoDbException may be thrown when the same attribute is updated by multiple sources.

0 commit comments

Comments
 (0)