Class AbstractCrossTableBatchWriteBuilder<S extends AbstractCrossTableBatchWriteBuilder<S>>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractCrossTableBatchWriteBuilder<S>
- Type Parameters:
S- the concrete builder type (for fluent chaining)
- Direct Known Subclasses:
AsyncCrossTableBatchWriteBuilder, CrossTableBatchWriteBuilder
public abstract class AbstractCrossTableBatchWriteBuilder<S extends AbstractCrossTableBatchWriteBuilder<S>>
extends Object
Abstract base for sync and async cross-table batch write builders.
Manages operations (put and delete), consumed capacity settings, and request item building shared across sync and async variants.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordStores a table reference, operation type, and optional item or key values. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final org.slf4j.LoggerLogger for this builder class.protected final List<AbstractCrossTableBatchWriteBuilder.Operation> The list of operations (put/delete) in this batch write.protected software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacityOptional consumed capacity reporting level. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs a newAbstractCrossTableBatchWriteBuilder. -
Method Summary
Modifier and TypeMethodDescriptionprotected static @NonNull software.amazon.awssdk.enhanced.dynamodb.KeyBuilds aKeyfrom partition and optional sort key values.Builds the request items map from the current operations.@NonNull SAdds a delete action for the given partition key in the given table.@NonNull SAdds a delete action for the given partition and sort key in the given table.protected abstract @NonNull StringgetTableName(@NonNull AbstractCrossTableBatchWriteBuilder.Operation operation) Extracts the DynamoDB table name from an operation's table reference.protected abstract @NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<?> getTableSchema(@NonNull AbstractCrossTableBatchWriteBuilder.Operation operation) Extracts the table schema from an operation's table reference.<T> @NonNull SAdds a put action to insert or replace an item in the given table.@NonNull SreturnConsumedCapacity(@NonNull software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacity) Configures whether to return consumed capacity information for the operation.protected abstract @NonNull Sself()Returnsthistyped asSfor fluent chaining.
-
Field Details
-
LOG
protected static final org.slf4j.Logger LOGLogger for this builder class. -
operations
The list of operations (put/delete) in this batch write. -
returnConsumedCapacity
protected software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacityOptional consumed capacity reporting level.
-
-
Constructor Details
-
AbstractCrossTableBatchWriteBuilder
protected AbstractCrossTableBatchWriteBuilder()Constructs a newAbstractCrossTableBatchWriteBuilder.
-
-
Method Details
-
self
Returnsthistyped asSfor fluent chaining.- Returns:
- this builder
-
getTableName
protected abstract @NonNull String getTableName(@NonNull AbstractCrossTableBatchWriteBuilder.Operation operation) Extracts the DynamoDB table name from an operation's table reference.- Parameters:
operation- the operation whose table name to extract- Returns:
- the DynamoDB table name
-
getTableSchema
protected abstract @NonNull software.amazon.awssdk.enhanced.dynamodb.TableSchema<?> getTableSchema(@NonNull AbstractCrossTableBatchWriteBuilder.Operation operation) Extracts the table schema from an operation's table reference.- Parameters:
operation- the operation whose table schema to extract- Returns:
- the table schema
-
put
-
delete
-
delete
public @NonNull S delete(@NonNull Object table, @NonNull Object partitionKey, @NonNull Object sortKey) Adds a delete action for the given partition and sort key in the given table.- Parameters:
table- the table to delete frompartitionKey- the partition key valuesortKey- the sort key value- Returns:
- this builder
-
returnConsumedCapacity
public @NonNull S returnConsumedCapacity(@NonNull software.amazon.awssdk.services.dynamodb.model.ReturnConsumedCapacity returnConsumedCapacity) Configures whether to return consumed capacity information for the operation.- Parameters:
returnConsumedCapacity- the consumed capacity reporting level- Returns:
- this builder for chaining
-
buildRequestItems
-
buildKey
protected static @NonNull software.amazon.awssdk.enhanced.dynamodb.Key buildKey(@NonNull Object partitionKey, @Nullable Object sortKey) Builds aKeyfrom partition and optional sort key values.- Parameters:
partitionKey- the partition key valuesortKey- the sort key value, ornullif the table has no sort key- Returns:
- the constructed key
-