Class TransactWriteItemsEnhancedRequest.Builder
java.lang.Object
software.amazon.awssdk.enhanced.dynamodb.model.TransactWriteItemsEnhancedRequest.Builder
- Enclosing class:
TransactWriteItemsEnhancedRequest
A builder that is used to create a transaction object with the desired parameters.
A valid builder should contain at least one low-level request such as DeleteItemEnhancedRequest
.
-
Method Summary
Modifier and TypeMethodDescriptionaddConditionCheck
(MappedTableResource<T> mappedTableResource, Consumer<ConditionCheck.Builder> requestConsumer) Adds a condition check for a primary key in the associated table to the transaction by accepting a consumer ofConditionCheck.Builder
.addConditionCheck
(MappedTableResource<T> mappedTableResource, ConditionCheck<T> request) Adds a condition check for a primary key in the associated table to the transaction.addDeleteItem
(MappedTableResource<T> mappedTableResource, Key key) Adds a primary lookup key for the item to delete, and it's associated table, to the transaction.addDeleteItem
(MappedTableResource<T> mappedTableResource, DeleteItemEnhancedRequest request) Deprecated.addDeleteItem
(MappedTableResource<T> mappedTableResource, TransactDeleteItemEnhancedRequest request) Adds a primary lookup key for the item to delete, and its associated table, to the transaction.addDeleteItem
(MappedTableResource<T> mappedTableResource, T keyItem) Adds a primary lookup key for the item to delete, and it's associated table, to the transaction.addPutItem
(MappedTableResource<T> mappedTableResource, PutItemEnhancedRequest<T> request) Deprecated.addPutItem
(MappedTableResource<T> mappedTableResource, TransactPutItemEnhancedRequest<T> request) Adds an item to be written, and it's associated table, to the transaction.addPutItem
(MappedTableResource<T> mappedTableResource, T item) Adds an item to be written, and it's associated table, to the transaction.addUpdateItem
(MappedTableResource<T> mappedTableResource, TransactUpdateItemEnhancedRequest<T> request) Adds an item to be updated, and it's associated table, to the transaction.addUpdateItem
(MappedTableResource<T> mappedTableResource, UpdateItemEnhancedRequest<T> request) addUpdateItem
(MappedTableResource<T> mappedTableResource, T item) Adds an item to be updated, and it's associated table, to the transaction.build()
Builds aTransactWriteItemsEnhancedRequest
from the values stored in this builder.clientRequestToken
(String clientRequestToken) Sets the clientRequestToken in this builder.
-
Method Details
-
addConditionCheck
public <T> TransactWriteItemsEnhancedRequest.Builder addConditionCheck(MappedTableResource<T> mappedTableResource, ConditionCheck<T> request) Adds a condition check for a primary key in the associated table to the transaction.Note: The condition check should be applied to an item that is not modified by another action in the same transaction. See
ConditionCheck
for more information on how to build a condition check, and the DynamoDb TransactWriteItems documentation for more information on how a condition check affects the transaction.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table on which to apply the condition checkrequest
- AConditionCheck
definition- Returns:
- a builder of this type
-
addConditionCheck
public <T> TransactWriteItemsEnhancedRequest.Builder addConditionCheck(MappedTableResource<T> mappedTableResource, Consumer<ConditionCheck.Builder> requestConsumer) Adds a condition check for a primary key in the associated table to the transaction by accepting a consumer ofConditionCheck.Builder
.Note: The condition check should be applied to an item that is not modified by another action in the same transaction. See
ConditionCheck
for more information on how to build a condition check, and the DynamoDb TransactWriteItems documentation for more information on how a condition check affects the transaction.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table on which to apply the condition checkrequestConsumer
- aConsumer
ofDeleteItemEnhancedRequest
- Returns:
- a builder of this type
-
addDeleteItem
@Deprecated public <T> TransactWriteItemsEnhancedRequest.Builder addDeleteItem(MappedTableResource<T> mappedTableResource, DeleteItemEnhancedRequest request) Adds a primary lookup key for the item to delete, and it's associated table, to the transaction. For more information on the delete action, see the low-level operation description in for instanceDynamoDbTable.deleteItem(DeleteItemEnhancedRequest)
and how to construct the low-level request inDeleteItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table where the key is locatedrequest
- ADeleteItemEnhancedRequest
- Returns:
- a builder of this type
-
addDeleteItem
public <T> TransactWriteItemsEnhancedRequest.Builder addDeleteItem(MappedTableResource<T> mappedTableResource, TransactDeleteItemEnhancedRequest request) Adds a primary lookup key for the item to delete, and its associated table, to the transaction. For more information on the delete action, see the low-level operation description in for instanceDynamoDbTable.deleteItem(DeleteItemEnhancedRequest)
and how to construct the low-level request inTransactDeleteItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table where the key is locatedrequest
- ATransactDeleteItemEnhancedRequest
- Returns:
- a builder of this type
-
addDeleteItem
public <T> TransactWriteItemsEnhancedRequest.Builder addDeleteItem(MappedTableResource<T> mappedTableResource, Key key) Adds a primary lookup key for the item to delete, and it's associated table, to the transaction. For more information on the delete action, see the low-level operation description in for instanceDynamoDbTable.deleteItem(DeleteItemEnhancedRequest)
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table where the key is locatedkey
- aKey
that identifies the record to be deleted as part of the transaction.- Returns:
- a builder of this type
-
addDeleteItem
public <T> TransactWriteItemsEnhancedRequest.Builder addDeleteItem(MappedTableResource<T> mappedTableResource, T keyItem) Adds a primary lookup key for the item to delete, and it's associated table, to the transaction. For more information on the delete action, see the low-level operation description in for instanceDynamoDbTable.deleteItem(DeleteItemEnhancedRequest)
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table where the key is locatedkeyItem
- an item that will have its key fields used to match a record to retrieve from the database- Returns:
- a builder of this type
-
addPutItem
@Deprecated public <T> TransactWriteItemsEnhancedRequest.Builder addPutItem(MappedTableResource<T> mappedTableResource, PutItemEnhancedRequest<T> request) Deprecated.Adds an item to be written, and it's associated table, to the transaction. For more information on the put action, see the low-level operation description in for instanceDynamoDbTable.putItem(PutItemEnhancedRequest)
and how to construct the low-level request inPutItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item torequest
- APutItemEnhancedRequest
- Returns:
- a builder of this type
-
addPutItem
public <T> TransactWriteItemsEnhancedRequest.Builder addPutItem(MappedTableResource<T> mappedTableResource, TransactPutItemEnhancedRequest<T> request) Adds an item to be written, and it's associated table, to the transaction. For more information on the put action, see the low-level operation description in for instanceDynamoDbTable.putItem(PutItemEnhancedRequest)
and how to construct the low-level request inTransactPutItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item torequest
- ATransactPutItemEnhancedRequest
- Returns:
- a builder of this type
-
addPutItem
public <T> TransactWriteItemsEnhancedRequest.Builder addPutItem(MappedTableResource<T> mappedTableResource, T item) Adds an item to be written, and it's associated table, to the transaction. For more information on the put action, see the low-level operation description in for instanceDynamoDbTable.putItem(PutItemEnhancedRequest)
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item toitem
- the item to be inserted or overwritten in the database- Returns:
- a builder of this type
-
addUpdateItem
@Deprecated public <T> TransactWriteItemsEnhancedRequest.Builder addUpdateItem(MappedTableResource<T> mappedTableResource, UpdateItemEnhancedRequest<T> request) Adds an item to be updated, and it's associated table, to the transaction. For more information on the update action, see the low-level operation description in for instanceDynamoDbTable.updateItem(UpdateItemEnhancedRequest)
and how to construct the low-level request inUpdateItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item torequest
- AUpdateItemEnhancedRequest
- Returns:
- a builder of this type
-
addUpdateItem
public <T> TransactWriteItemsEnhancedRequest.Builder addUpdateItem(MappedTableResource<T> mappedTableResource, TransactUpdateItemEnhancedRequest<T> request) Adds an item to be updated, and it's associated table, to the transaction. For more information on the update action, see the low-level operation description in for instanceDynamoDbTable.updateItem(UpdateItemEnhancedRequest)
and how to construct the low-level request inTransactUpdateItemEnhancedRequest
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item torequest
- AUpdateItemEnhancedRequest
- Returns:
- a builder of this type
-
addUpdateItem
public <T> TransactWriteItemsEnhancedRequest.Builder addUpdateItem(MappedTableResource<T> mappedTableResource, T item) Adds an item to be updated, and it's associated table, to the transaction. For more information on the update action, see the low-level operation description in for instanceDynamoDbTable.updateItem(UpdateItemEnhancedRequest)
.- Type Parameters:
T
- the type of modelled objects in the table- Parameters:
mappedTableResource
- the table to write the item toitem
- an item to update or insert into the database as part of this transaction- Returns:
- a builder of this type
-
clientRequestToken
Sets the clientRequestToken in this builder.- Parameters:
clientRequestToken
- the clientRequestToken going to be used for build- Returns:
- a builder of this type
-
build
Builds aTransactWriteItemsEnhancedRequest
from the values stored in this builder.
-
addDeleteItem(MappedTableResource, TransactDeleteItemEnhancedRequest)