@ThreadSafe public interface BatchGetResultPageIterable extends SdkIterable<BatchGetResultPage>
DynamoDbEnhancedClient.batchGetItem(software.amazon.awssdk.enhanced.dynamodb.model.BatchGetItemEnhancedRequest)
operation.
The result can be accessed either through iterable BatchGetResultPage
s or flattened items
across all pages via resultsForTable(software.amazon.awssdk.enhanced.dynamodb.MappedTableResource<T>)
Example:
1) Iterating through pages
batchResults.forEach(page -> {
page.resultsForTable(firstItemTable).forEach(item -> System.out.println(item));
page.resultsForTable(secondItemTable).forEach(item -> System.out.println(item));
});
2) Iterating through items across all pages
results.resultsForTable(firstItemTable).forEach(item -> System.out.println(item));
results.resultsForTable(secondItemTable).forEach(item -> System.out.println(item));
Modifier and Type | Method and Description |
---|---|
static BatchGetResultPageIterable |
create(SdkIterable<BatchGetResultPage> pageIterable) |
default <T> SdkIterable<T> |
resultsForTable(MappedTableResource<T> mappedTable)
Retrieve all items belonging to the supplied table across all pages.
|
stream
forEach, iterator, spliterator
static BatchGetResultPageIterable create(SdkIterable<BatchGetResultPage> pageIterable)
default <T> SdkIterable<T> resultsForTable(MappedTableResource<T> mappedTable)
T
- the type of the table itemsmappedTable
- the table to retrieve items forCopyright © 2022. All rights reserved.