|
24 | 24 | import software.amazon.awssdk.enhanced.dynamodb.DynamoDbAsyncTable; |
25 | 25 | import software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable; |
26 | 26 | import software.amazon.awssdk.enhanced.dynamodb.Expression; |
27 | | -import software.amazon.awssdk.enhanced.dynamodb.update.AddAction; |
28 | | -import software.amazon.awssdk.enhanced.dynamodb.update.DeleteAction; |
29 | | -import software.amazon.awssdk.enhanced.dynamodb.update.RemoveAction; |
30 | | -import software.amazon.awssdk.enhanced.dynamodb.update.SetAction; |
31 | 27 | import software.amazon.awssdk.enhanced.dynamodb.update.UpdateExpression; |
32 | 28 | import software.amazon.awssdk.services.dynamodb.model.DeleteItemRequest; |
33 | 29 | import software.amazon.awssdk.services.dynamodb.model.PutItemRequest; |
@@ -332,21 +328,23 @@ public Builder<T> item(T item) { |
332 | 328 | } |
333 | 329 |
|
334 | 330 | /** |
335 | | - * Specifies custom update operations using DynamoDB's native update expression syntax. Enables advanced modifications |
336 | | - * like incrementing counters or modifying lists/sets. |
| 331 | + * Specifies custom update operations using DynamoDB's native update expression syntax. |
337 | 332 | * <p> |
338 | | - * <b>Precedence:</b> Request expressions (highest) > Extension expressions > Item attributes (lowest). |
339 | | - * This method overrides any conflicting operations from item attributes or extensions. |
| 333 | + * <b>Precedence:</b> When performing an update, the final set of attribute modifications is determined as follows: |
| 334 | + * <ol> |
| 335 | + * <li><b>Request-level UpdateExpression</b> (set via this method) has the highest priority and overrides any |
| 336 | + * conflicting updates from extensions or POJO item attributes.</li> |
| 337 | + * <li><b>Extension-provided UpdateExpression</b> (if present) has medium priority and overrides conflicting updates |
| 338 | + * from POJO item attributes.</li> |
| 339 | + * <li><b>POJO item attributes</b> have the lowest priority; any conflicts with extension or request expressions are |
| 340 | + * overridden.</li> |
| 341 | + * </ol> |
| 342 | + * If the same attribute is updated by multiple sources, only the action from the highest-priority source is applied. |
340 | 343 | * <p> |
341 | | - * <b>Backward compatible:</b> New feature that doesn't affect existing behavior when not used. |
| 344 | + * This method does not affect existing behavior if not used. |
342 | 345 | * |
343 | 346 | * @param updateExpression the update operations to perform |
344 | 347 | * @return a builder of this type |
345 | | - * @see UpdateExpression |
346 | | - * @see SetAction |
347 | | - * @see AddAction |
348 | | - * @see RemoveAction |
349 | | - * @see DeleteAction |
350 | 348 | */ |
351 | 349 | public Builder<T> updateExpression(UpdateExpression updateExpression) { |
352 | 350 | this.updateExpression = updateExpression; |
|
0 commit comments