Class AsyncUpdateBuilder<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractUpdateBuilder<T, AsyncUpdateBuilder<T>>
dev.hogwai.dynamodb.simplified.async.AsyncUpdateBuilder<T>
- Type Parameters:
T- the type of the item
Async fluent builder for updating an item in a DynamoDB table.
Supports both full-item replacement and partial updates via an
UpdateExpression.
Part of the DynamoDB Simplified library.-
Field Summary
Fields inherited from class AbstractUpdateBuilder
conditionExpression, ignoreNulls, item, keyMap, LOG, optimisticLocking, returnValues, updateExpression -
Method Summary
Modifier and TypeMethodDescription@NonNull CompletableFuture<Optional<T>> execute()Executes the update operation.protected @NonNull software.amazon.awssdk.enhanced.dynamodb.KeyReturns aKeybuilt from the current item.protected @NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<T> Returns the table schema for the item type.protected @NonNull AsyncUpdateBuilder<T> self()Returnsthistyped asSfor fluent chaining.protected @NonNull StringReturns the DynamoDB table name.Methods inherited from class AbstractUpdateBuilder
applyOptimisticLocking, buildKeyMap, buildKeyMapFromValues, condition, condition, ignoreNulls, incrementVersion, returnValues, update, withOptimisticLocking
-
Method Details
-
self
Description copied from class:AbstractUpdateBuilderReturnsthistyped asSfor fluent chaining.- Specified by:
selfin classAbstractUpdateBuilder<T, AsyncUpdateBuilder<T>>- Returns:
- this builder
-
tableName
Description copied from class:AbstractUpdateBuilderReturns the DynamoDB table name.- Specified by:
tableNamein classAbstractUpdateBuilder<T, AsyncUpdateBuilder<T>>- Returns:
- the DynamoDB table name
-
getKeyFromItem
protected @NonNull software.amazon.awssdk.enhanced.dynamodb.Key getKeyFromItem()Description copied from class:AbstractUpdateBuilderReturns aKeybuilt from the current item. Used internally to build key maps for partial update requests.- Specified by:
getKeyFromItemin classAbstractUpdateBuilder<T, AsyncUpdateBuilder<T>>- Returns:
- the key derived from the item
-
getTableSchema
Description copied from class:AbstractUpdateBuilderReturns the table schema for the item type. Used internally for key and attribute conversion.- Specified by:
getTableSchemain classAbstractUpdateBuilder<T, AsyncUpdateBuilder<T>>- Returns:
- the table schema
-
execute
Executes the update operation. If a partial update expression was configured viaAbstractUpdateBuilder.update(java.util.function.Consumer), a targeted partial update is performed via the low-level async DynamoDB client. Otherwise, the full item is replaced.- Returns:
- a
CompletableFuturecontaining the updated item, or empty if not found
-