public class TableClient extends Object
TableClientBuilder.buildClient() method on a
TableClientBuilder object.| Modifier and Type | Method and Description |
|---|---|
void |
create()
Creates the table within the Tables service.
|
void |
create(Duration timeout)
Creates the table within the Tables service.
|
TableBatch |
createBatch(String partitionKey)
Creates a new
TableBatch object. |
void |
createEntity(TableEntity entity)
Inserts an entity into the table.
|
void |
createEntity(TableEntity entity,
Duration timeout)
Inserts an entity into the table.
|
com.azure.core.http.rest.Response<Void> |
createEntityWithResponse(TableEntity entity,
Duration timeout,
com.azure.core.util.Context context)
Inserts an entity into the table.
|
com.azure.core.http.rest.Response<Void> |
createWithResponse(Duration timeout,
com.azure.core.util.Context context)
Creates the table within the Tables service.
|
void |
delete()
Deletes the table within the Tables service.
|
void |
delete(Duration timeout)
Deletes the table within the Tables service.
|
void |
deleteEntity(String partitionKey,
String rowKey)
Deletes an entity from the table.
|
void |
deleteEntity(String partitionKey,
String rowKey,
String eTag)
Deletes an entity from the table.
|
void |
deleteEntity(String partitionKey,
String rowKey,
String eTag,
Duration timeout)
Deletes an entity from the table.
|
com.azure.core.http.rest.Response<Void> |
deleteEntityWithResponse(String partitionKey,
String rowKey,
String eTag,
Duration timeout,
com.azure.core.util.Context context)
Deletes an entity from the table.
|
com.azure.core.http.rest.Response<Void> |
deleteWithResponse(Duration timeout,
com.azure.core.util.Context context)
Deletes the table within the Tables service.
|
String |
getAccountName()
Gets the name of the account containing the table.
|
TablesServiceVersion |
getApiVersion()
Gets the REST API version used by this client.
|
TableEntity |
getEntity(String partitionKey,
String rowKey)
Gets a single entity from the table.
|
<T extends TableEntity> |
getEntity(String partitionKey,
String rowKey,
Class<T> resultType)
Gets a single entity from the table.
|
TableEntity |
getEntity(String partitionKey,
String rowKey,
String select)
Gets a single entity from the table.
|
<T extends TableEntity> |
getEntity(String partitionKey,
String rowKey,
String select,
Class<T> resultType)
Gets a single entity from the table.
|
<T extends TableEntity> |
getEntity(String partitionKey,
String rowKey,
String select,
Class<T> resultType,
Duration timeout)
Gets a single entity from the table.
|
TableEntity |
getEntity(String partitionKey,
String rowKey,
String select,
Duration timeout)
Gets a single entity from the table.
|
<T extends TableEntity> |
getEntityWithResponse(String partitionKey,
String rowKey,
String select,
Class<T> resultType,
Duration timeout,
com.azure.core.util.Context context)
Gets a single entity from the table.
|
com.azure.core.http.rest.Response<TableEntity> |
getEntityWithResponse(String partitionKey,
String rowKey,
String select,
Duration timeout,
com.azure.core.util.Context context)
Gets a single entity from the table.
|
String |
getTableName()
Gets the name of the table.
|
String |
getTableUrl()
Gets the absolute URL for this table.
|
com.azure.core.http.rest.PagedIterable<TableEntity> |
listEntities()
Lists all entities within the table.
|
<T extends TableEntity> |
listEntities(Class<T> resultType)
Lists all entities within the table.
|
com.azure.core.http.rest.PagedIterable<TableEntity> |
listEntities(ListEntitiesOptions options)
Lists entities using the parameters in the provided options.
|
<T extends TableEntity> |
listEntities(ListEntitiesOptions options,
Class<T> resultType)
Lists entities using the parameters in the provided options.
|
void |
updateEntity(TableEntity entity)
Updates an existing entity by merging the provided entity with the existing entity.
|
void |
updateEntity(TableEntity entity,
UpdateMode updateMode)
Updates an existing entity using the specified update mode.
|
void |
updateEntity(TableEntity entity,
UpdateMode updateMode,
boolean ifUnchanged)
Updates an existing entity using the specified update mode.
|
void |
updateEntity(TableEntity entity,
UpdateMode updateMode,
boolean ifUnchanged,
Duration timeout)
Updates an existing entity using the specified update mode.
|
com.azure.core.http.rest.Response<Void> |
updateEntityWithResponse(TableEntity entity,
UpdateMode updateMode,
boolean ifUnchanged,
Duration timeout,
com.azure.core.util.Context context)
Updates an existing entity using the specified update mode.
|
void |
upsertEntity(TableEntity entity)
Inserts an entity into the table if it does not exist, or merges the entity with the existing entity otherwise.
|
void |
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.
|
void |
upsertEntity(TableEntity entity,
UpdateMode updateMode,
Duration timeout)
Inserts an entity into the table if it does not exist, or updates the existing entity using the specified update
mode otherwise.
|
com.azure.core.http.rest.Response<Void> |
upsertEntityWithResponse(TableEntity entity,
UpdateMode updateMode,
Duration timeout,
com.azure.core.util.Context context)
Inserts an entity into the table if it does not exist, or updates the existing entity using the specified update
mode otherwise.
|
public String getTableName()
public String getAccountName()
public String getTableUrl()
public TablesServiceVersion getApiVersion()
public TableBatch createBatch(String partitionKey)
TableBatch object. Batch objects allow you to enqueue multiple create, update, upsert,
and/or delete operations on entities that share the same partition key. When the batch is executed, all of the
operations will be performed as part of a single transaction. As a result, either all operations in the batch
will succeed, or if a failure occurs, all operations in the batch will be rolled back. Each operation in a batch
must operate on a distinct row key. Attempting to add multiple operations to a batch that share the same row key
will cause an exception to be thrown.partitionKey - The partition key shared by all operations in the batch.IllegalArgumentException - if the provided partition key is null or empty.public void create()
com.azure.data.tables.implementation.models.TableServiceErrorException - if a table with the same name already exists within the service.public void create(Duration timeout)
timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if a table with the same name already exists within the service.RuntimeException - if the provided timeout expires.public com.azure.core.http.rest.Response<Void> createWithResponse(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 a table with the same name already exists within the service.RuntimeException - if the provided timeout expires.public void createEntity(TableEntity entity)
entity - The entity to insert.com.azure.data.tables.implementation.models.TableServiceErrorException - if an entity with the same partition key and row key already exists within the
table.IllegalArgumentException - if the provided entity is invalid.public void createEntity(TableEntity entity, Duration timeout)
entity - The entity to insert.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if an entity with the same partition key and row key already exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public com.azure.core.http.rest.Response<Void> createEntityWithResponse(TableEntity entity, Duration timeout, com.azure.core.util.Context context)
entity - The entity to insert.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 an entity with the same partition key and row key already exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public void upsertEntity(TableEntity entity)
entity - The entity to upsert.IllegalArgumentException - if the provided entity is invalid.public void upsertEntity(TableEntity entity, UpdateMode updateMode)
entity - The entity to upsert.updateMode - The type of update to perform if the entity already exits.IllegalArgumentException - if the provided entity is invalid.public void upsertEntity(TableEntity entity, UpdateMode updateMode, Duration timeout)
entity - The entity to upsert.updateMode - The type of update to perform if the entity already exits.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public com.azure.core.http.rest.Response<Void> upsertEntityWithResponse(TableEntity entity, UpdateMode updateMode, Duration timeout, com.azure.core.util.Context context)
entity - The entity to upsert.updateMode - The type of update to perform if the entity already exits.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 the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public void updateEntity(TableEntity entity)
entity - The entity to update.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the same partition key and row key exists within the table.IllegalArgumentException - if the provided entity is invalid.public void updateEntity(TableEntity entity, UpdateMode updateMode)
entity - The entity to update.updateMode - which type of mode to executecom.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the same partition key and row key exists within the table.IllegalArgumentException - if the provided entity is invalid.public void 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.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the same partition key and row key exists within the table,
or if ifUnchanged is true and the existing entity's eTag does
not match that of the provided entity.IllegalArgumentException - if the provided entity is invalid.public void updateEntity(TableEntity entity, UpdateMode updateMode, boolean ifUnchanged, Duration timeout)
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.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the same partition key and row key exists within the table,
or if ifUnchanged is true and the existing entity's eTag does
not match that of the provided entity, or if the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public com.azure.core.http.rest.Response<Void> updateEntityWithResponse(TableEntity entity, UpdateMode updateMode, boolean ifUnchanged, Duration timeout, com.azure.core.util.Context context)
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.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 no entity with the same partition key and row key exists within the table,
or if ifUnchanged is true and the existing entity's eTag does
not match that of the provided entity, or if the provided timeout expires.IllegalArgumentException - if the provided entity is invalid.public void delete()
com.azure.data.tables.implementation.models.TableServiceErrorException - if no table with this name exists within the service.public void delete(Duration timeout)
timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if no table with this name exists within the service.RuntimeException - if the provided timeout expires.public com.azure.core.http.rest.Response<Void> deleteWithResponse(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 no table with this name exists within the service.RuntimeException - if the provided timeout expires.public void deleteEntity(String partitionKey, String rowKey)
partitionKey - The partition key of the entity.rowKey - The row key of the entity.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table.IllegalArgumentException - if the provided partition key or row key are null or empty.public void deleteEntity(String partitionKey, String rowKey, String eTag)
partitionKey - The partition key of the entity.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.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table, or if eTag is not null and the existing entity's eTag
does not match that of the provided entity.IllegalArgumentException - if the provided partition key or row key are null or empty.public void deleteEntity(String partitionKey, String rowKey, String eTag, Duration timeout)
partitionKey - The partition key of the entity.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.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table, or if eTag is not null and the existing entity's eTag
does not match that of the provided entity, or if the provided timeout
expires.IllegalArgumentException - if the provided partition key or row key are null or empty.public com.azure.core.http.rest.Response<Void> deleteEntityWithResponse(String partitionKey, String rowKey, String eTag, Duration timeout, com.azure.core.util.Context context)
partitionKey - The partition key of the entity.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.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 no entity with the provided partition key and row key exists within the
table, or if eTag is not null and the existing entity's eTag
does not match that of the provided entity, or if the provided timeout
expires.IllegalArgumentException - if the provided partition key or row key are null or empty.public com.azure.core.http.rest.PagedIterable<TableEntity> listEntities()
public com.azure.core.http.rest.PagedIterable<TableEntity> listEntities(ListEntitiesOptions options)
options - The `filter`, `select`, and `top` OData query options to apply to this operation.IllegalArgumentException - if one or more of the OData query options in options is malformed.public <T extends TableEntity> com.azure.core.http.rest.PagedIterable<T> listEntities(Class<T> resultType)
T - The type of the result value, which must be a subclass of TableEntity.resultType - The type of the result value, which must be a subclass of TableEntity.IllegalArgumentException - if an instance of the provided resultType can't be created.public <T extends TableEntity> com.azure.core.http.rest.PagedIterable<T> listEntities(ListEntitiesOptions options, Class<T> resultType)
T - The type of the result value, which must be a subclass of TableEntity.options - The `filter`, `select`, and `top` OData query options to apply to this operation.resultType - The type of the result value, which must be a subclass of TableEntity.IllegalArgumentException - if one or more of the OData query options in options is malformed, or if
an instance of the provided resultType can't be created.public TableEntity getEntity(String partitionKey, String rowKey)
partitionKey - The partition key of the entity.rowKey - The partition key of the entity.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table.IllegalArgumentException - if the provided partition key or row key are null or empty.public TableEntity getEntity(String partitionKey, String rowKey, String select)
partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table.IllegalArgumentException - if the provided partition key or row key are null or empty, or if the
select OData query option is malformed.public <T extends TableEntity> T getEntity(String partitionKey, String rowKey, Class<T> resultType)
T - The type of the result value, which must be a subclass of TableEntity.partitionKey - The partition key of the entity.rowKey - The partition key of the entity.resultType - The type of the result value, which must be a subclass of TableEntity.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table.IllegalArgumentException - if the provided partition key or row key are null or empty, or if an
instance of the provided resultType can't be created.public <T extends TableEntity> T getEntity(String partitionKey, String rowKey, String select, Class<T> resultType)
T - The type of the result value, which must be a subclass of TableEntity.partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.resultType - The type of the result value, which must be a subclass of TableEntity.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table.IllegalArgumentException - if the provided partition key or row key are null or empty, if the
select OData query option is malformed, or if an instance of the
provided resultType can't be created.public TableEntity getEntity(String partitionKey, String rowKey, String select, Duration timeout)
partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided partition key or row key are null or empty, or if the
select OData query option is malformed.public <T extends TableEntity> T getEntity(String partitionKey, String rowKey, String select, Class<T> resultType, Duration timeout)
T - The type of the result value, which must be a subclass of TableEntity.partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.resultType - The type of the result value, which must be a subclass of TableEntity.timeout - Duration to wait for the operation to complete.com.azure.data.tables.implementation.models.TableServiceErrorException - if no entity with the provided partition key and row key exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided partition key or row key are null or empty, if the
select OData query option is malformed, or if an instance of the
provided resultType can't be created.public com.azure.core.http.rest.Response<TableEntity> getEntityWithResponse(String partitionKey, String rowKey, String select, Duration timeout, com.azure.core.util.Context context)
partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.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 no entity with the provided partition key and row key exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided partition key or row key are null or empty, or if the
select OData query option is malformed.public <T extends TableEntity> com.azure.core.http.rest.Response<T> getEntityWithResponse(String partitionKey, String rowKey, String select, Class<T> resultType, Duration timeout, com.azure.core.util.Context context)
T - The type of the result value, which must be a subclass of TableEntity.partitionKey - The partition key of the entity.rowKey - The partition key of the entity.select - An OData `select` expression to limit the set of properties included in the returned entity.resultType - The type of the result value, which must be a subclass of TableEntity.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 no entity with the provided partition key and row key exists within the
table, or if the provided timeout expires.IllegalArgumentException - if the provided partition key or row key are null or empty, if the
select OData query option is malformed, or if an instance of the
provided resultType can't be created.Copyright © 2021 Microsoft Corporation. All rights reserved.