Class DeleteBuilder<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractDeleteBuilder<T, DeleteBuilder<T>>
dev.hogwai.dynamodb.simplified.builder.DeleteBuilder<T>
- Type Parameters:
T- the type of the item
A fluent builder for deleting an item from a DynamoDB table by its key,
with an optional condition expression. Part of the DynamoDB Simplified library.
-
Field Summary
Fields inherited from class AbstractDeleteBuilder
conditionExpression, LOG, partitionKey, returnValues, sortKey -
Constructor Summary
ConstructorsConstructorDescriptionDeleteBuilder(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable<T> table, @NonNull Object partitionKey, @Nullable Object sortKey, @Nullable software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a newDeleteBuilderfor the given table and key. -
Method Summary
Modifier and TypeMethodDescriptionexecute()Executes the delete operation and returns the deleted item.@NonNull DeleteBuilder<T> returnValues(@Nullable software.amazon.awssdk.services.dynamodb.model.ReturnValue returnValues) Configures the return values for the delete operation.protected DeleteBuilder<T> self()Returnsthistyped asSfor fluent chaining.protected @NonNull StringReturns the DynamoDB table name.Methods inherited from class AbstractDeleteBuilder
buildEnhancedRequest, buildKeyMap, buildLowLevelRequest, condition, condition, onlyIfExists
-
Constructor Details
-
DeleteBuilder
public DeleteBuilder(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable<T> table, @NonNull Object partitionKey, @Nullable Object sortKey, @Nullable software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a newDeleteBuilderfor the given table and key.- Parameters:
table- the DynamoDB tablepartitionKey- the partition key valuesortKey- the sort key value (may benullif the table has no sort key)dynamoDbClient- the low-level DynamoDB client (required for returnValues support)
-
-
Method Details
-
self
Description copied from class:AbstractDeleteBuilderReturnsthistyped asSfor fluent chaining.- Specified by:
selfin classAbstractDeleteBuilder<T, DeleteBuilder<T>>- Returns:
- this builder
-
tableName
Description copied from class:AbstractDeleteBuilderReturns the DynamoDB table name.- Specified by:
tableNamein classAbstractDeleteBuilder<T, DeleteBuilder<T>>- Returns:
- the DynamoDB table name
-
returnValues
public @NonNull DeleteBuilder<T> returnValues(@Nullable software.amazon.awssdk.services.dynamodb.model.ReturnValue returnValues) Configures the return values for the delete operation. When set (e.g.,ReturnValue.ALL_OLD), the operation falls back to the low-levelDynamoDbClient.deleteItem(DeleteItemRequest)to include the return values in the request.- Overrides:
returnValuesin classAbstractDeleteBuilder<T, DeleteBuilder<T>>- Parameters:
returnValues- the return value setting, ornullto use the default- Returns:
- this builder for chaining
-
execute
-