public final class TableBatch extends Object
TableClient.createBatch(String) method on a TableClient object.| Modifier and Type | Method and Description |
|---|---|
TableBatch |
createEntity(TableEntity entity)
Inserts an entity into the table.
|
TableBatch |
deleteEntity(String rowKey)
Deletes an entity from the table.
|
TableBatch |
deleteEntity(String rowKey,
String eTag)
Deletes an entity from the table.
|
List<com.azure.data.tables.implementation.models.BatchOperation> |
getOperations()
Gets an immutable list containing all operations added to this batch.
|
List<BatchOperationResponse> |
submitTransaction()
Executes all operations within The batch inside a transaction.
|
List<BatchOperationResponse> |
submitTransaction(Duration timeout)
Executes all operations within The batch inside a transaction.
|
com.azure.core.http.rest.Response<List<BatchOperationResponse>> |
submitTransactionWithResponse(Duration timeout,
com.azure.core.util.Context context)
Executes all operations within The batch inside a transaction.
|
TableBatch |
updateEntity(TableEntity entity)
Updates an existing entity by merging the provided entity with the existing entity.
|
TableBatch |
updateEntity(TableEntity entity,
UpdateMode updateMode)
Updates an existing entity using the specified update mode.
|
TableBatch |
updateEntity(TableEntity entity,
UpdateMode updateMode,
boolean ifUnchanged)
Updates an existing entity using the specified update mode.
|
TableBatch |
upsertEntity(TableEntity entity)
Inserts an entity into the table if it does not exist, or merges the entity with the existing entity otherwise.
|
TableBatch |
upsertEntity(TableEntity entity,
UpdateMode updateMode)
Inserts an entity into the table if it does not exist, or updates the existing entity using the specified update
mode otherwise.
|
public TableBatch createEntity(TableEntity entity)
entity - The entity to insert.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch upsertEntity(TableEntity entity)
entity - The entity to upsert.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch upsertEntity(TableEntity entity, UpdateMode updateMode)
entity - The entity to upsert.updateMode - The type of update to perform if the entity already exits.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch updateEntity(TableEntity entity)
entity - The entity to update.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch updateEntity(TableEntity entity, UpdateMode updateMode)
entity - The entity to update.updateMode - The type of update to perform.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch updateEntity(TableEntity entity, UpdateMode updateMode, boolean ifUnchanged)
entity - The entity to update.updateMode - The type of update to perform.ifUnchanged - When true, the eTag of the provided entity must match the eTag of the entity in the Table
service. If the values do not match, the update will not occur and an exception will be thrown.TableBatch.IllegalArgumentException - if the entity's partition key does not match the partition key provided when
creating this TableBatch object, if the entity's row key is null or empty, or if another
operation with the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch deleteEntity(String rowKey)
rowKey - The row key of the entity.TableBatch.IllegalArgumentException - if the provided row key is null or empty, or if another operation with
the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public TableBatch deleteEntity(String rowKey, String eTag)
rowKey - The row key of the entity.eTag - The value to compare with the eTag of the entity in the Tables service. If the values do not match,
the delete will not occur and an exception will be thrown.TableBatch.IllegalArgumentException - if the provided row key is null or empty, or if another operation with
the same row key has already been added to the batch.IllegalStateException - if this method is called after the batch has been submitted.public List<com.azure.data.tables.implementation.models.BatchOperation> getOperations()
public List<BatchOperationResponse> submitTransaction()
com.azure.data.tables.implementation.models.TableServiceErrorException - if any operation within the batch fails. See the documentation for the client
methods in TableClient to understand the conditions that may cause a given operation to fail.IllegalStateException - if no operations have been added to the batch.public List<BatchOperationResponse> submitTransaction(Duration timeout)
timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if any operation within the batch fails. See the documentation for the client
methods in TableClient to understand the conditions that may cause a given operation to fail.IllegalStateException - if no operations have been added to the batch.public com.azure.core.http.rest.Response<List<BatchOperationResponse>> submitTransactionWithResponse(Duration timeout, com.azure.core.util.Context context)
timeout - Duration to wait for the operation to complete.context - Additional context that is passed through the HTTP pipeline during the service call.com.azure.data.tables.implementation.models.TableServiceErrorException - if any operation within the batch fails. See the documentation for the client
methods in TableClient to understand the conditions that may cause a given operation to fail.IllegalStateException - if no operations have been added to the batch.Copyright © 2021 Microsoft Corporation. All rights reserved.