Class BatchGetBuilder<T>
java.lang.Object
dev.hogwai.dynamodb.simplified.builder.base.AbstractBatchGetBuilder<T, BatchGetBuilder<T>>
dev.hogwai.dynamodb.simplified.builder.BatchGetBuilder<T>
- Type Parameters:
T- the item type
Builds a batch get operation to retrieve multiple items from a single table by their keys.
Obtain via Table.batchGet().
-
Field Summary
Fields inherited from class AbstractBatchGetBuilder
consistentRead, keys, projectionExpression, returnConsumedCapacity -
Constructor Summary
ConstructorsConstructorDescriptionBatchGetBuilder(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient enhancedClient, @NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable<T> table, @NonNull software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a batch get builder for the given table. -
Method Summary
Modifier and TypeMethodDescription@NonNull BatchGetResult<T> execute()Executes the batch get operation and returns all matching items along with any unprocessed keys.protected BatchGetBuilder<T> self()Returnsthistyped asSfor fluent chaining.protected @NonNull StringReturns the DynamoDB table name.Methods inherited from class AbstractBatchGetBuilder
addKey, addKey, addKeys, buildKeysAndAttributes, consistentRead, keys, project, project, returnConsumedCapacity
-
Constructor Details
-
BatchGetBuilder
public BatchGetBuilder(@NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbEnhancedClient enhancedClient, @NonNull software.amazon.awssdk.enhanced.dynamodb.DynamoDbTable<T> table, @NonNull software.amazon.awssdk.services.dynamodb.DynamoDbClient dynamoDbClient) Constructs a batch get builder for the given table.Typically obtained via
Table.batchGet().- Parameters:
enhancedClient- the enhanced DynamoDB clienttable- the typed DynamoDB tabledynamoDbClient- the low-level DynamoDB client (used for projection fallback)
-
-
Method Details
-
self
Description copied from class:AbstractBatchGetBuilderReturnsthistyped asSfor fluent chaining.- Specified by:
selfin classAbstractBatchGetBuilder<T, BatchGetBuilder<T>>- Returns:
- this builder
-
tableName
Description copied from class:AbstractBatchGetBuilderReturns the DynamoDB table name.- Specified by:
tableNamein classAbstractBatchGetBuilder<T, BatchGetBuilder<T>>- Returns:
- the DynamoDB table name
-
execute
Executes the batch get operation and returns all matching items along with any unprocessed keys.If a projection was set via
AbstractBatchGetBuilder.project(String...), the operation falls back to the low-level DynamoDB API to support attribute filtering.- Returns:
- a
BatchGetResultcontaining the retrieved items and unprocessed keys - Throws:
IllegalArgumentException- if more than 100 keys are provided
-