Aracılığıyla paylaş


QueryTableOperation Class

  • java.lang.Object
    • TableOperation
      • com.microsoft.azure.storage.table.QueryTableOperation

public class QueryTableOperation extends TableOperation

A class that extends TableOperation to implement a query to retrieve a single table entity. To execute a QueryTableOperation instance, call the method on a CloudTableClient instance. This operation can be executed directly or as part of a TableBatchOperation. If the QueryTableOperation returns an entity result, it is stored in the corresponding TableResult returned by the method.

Constructor Summary

Constructor Description
QueryTableOperation()

Default constructor.

Method Summary

Modifier and Type Method and Description
Class<? extends TableEntity> getClazzType()

Reserved for internal use. Gets the class type of the entity returned by the query.

String getPartitionKey()

Gets the PartitionKey value for the entity to retrieve.

EntityResolver<?> getResolver()

Gets the resolver to project the entity retrieved as a particular type.

String getRowKey()

Gets the RowKey value for the entity to retrieve.

final boolean isPrimaryOnlyRetrieve()
TableResult parseResponse(final InputStream inStream, final int httpStatusCode, String etagFromHeader, final OperationContext opContext, final TableRequestOptions options)

Reserved for internal use. Parses the table operation response into a TableResult to return.

TableResult performRetrieve(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext)

Reserved for internal use. Performs a retrieve operation on the specified table, using the specified TableRequestOptions and OperationContext.

This method will invoke the Storage Service REST API to execute this table operation, using the Table service endpoint and storage account credentials in the CloudTableClient object.

void setClazzType(final Class<? extends TableEntity> clazzType)

Reserved for internal use. Sets the class type of the entity returned by the query.

void setPartitionKey(final String partitionKey)

Reserved for internal use. Sets the PartitionKey value for the entity to retrieve.

void setPrimaryOnlyRetrieve(boolean isPrimaryOnlyRetrieve)
void setResolver(final EntityResolver<?> resolver)

Reserved for internal use. Sets the resolver to project the entity retrieved as a particular type.

void setRowKey(final String rowKey)

Reserved for internal use. Sets the RowKey value for the entity to retrieve.

Inherited Members

Constructor Details

QueryTableOperation

protected QueryTableOperation()

Default constructor.

Method Details

getClazzType

protected Class getClazzType()

Reserved for internal use. Gets the class type of the entity returned by the query.

Returns:

The java.lang.Class implementing TableEntity that represents the entity type for the query.

getPartitionKey

public String getPartitionKey()

Gets the PartitionKey value for the entity to retrieve.

Returns:

A String containing the PartitionKey value for the entity.

getResolver

public EntityResolver getResolver()

Gets the resolver to project the entity retrieved as a particular type.

Returns:

The EntityResolver<T> instance.

getRowKey

public String getRowKey()

Gets the RowKey value for the entity to retrieve.

Returns:

A String containing the RowKey value for the entity.

isPrimaryOnlyRetrieve

protected final boolean isPrimaryOnlyRetrieve()

Returns:

the isPrimaryOnlyRetrieve

parseResponse

protected TableResult parseResponse(final InputStream inStream, final int httpStatusCode, String etagFromHeader, final OperationContext opContext, final TableRequestOptions options)

Reserved for internal use. Parses the table operation response into a TableResult to return.

Parameters:

inStream - An InputStream containing the response to a query operation.
httpStatusCode - The HTTP status code returned from the operation request.
etagFromHeader - The String containing the Etag returned with the operation response.
opContext - An OperationContext object that represents the context for the current operation.
options

Returns:

The TableResult representing the result of the query operation.

Throws:

InstantiationException - if an error occurs in object construction.
IllegalAccessException - if an error occurs in reflection on an object type.
StorageException - if an error occurs in the storage operation.
IOException - if an error occurs while accessing the InputStream with Json.
JsonParseException - if an error occurs while parsing the Json, if Json is used.

performRetrieve

protected TableResult performRetrieve(final CloudTableClient client, final String tableName, final TableRequestOptions options, final OperationContext opContext)

Reserved for internal use. Performs a retrieve operation on the specified table, using the specified TableRequestOptions and OperationContext.

This method will invoke the Storage Service REST API to execute this table operation, using the Table service endpoint and storage account credentials in the CloudTableClient object.

Parameters:

client - A CloudTableClient instance specifying the Table service endpoint and storage account credentials to use.
tableName - A String containing the name of the table to query.
options - A TableRequestOptions object that specifies execution options such as retry policy and timeout settings for the operation.
opContext - An OperationContext object for tracking the current operation.

Returns:

A TableResult containing the results of executing the query operation.

Throws:

StorageException - if an error occurs in the storage operation.

setClazzType

protected void setClazzType(final Class clazzType)

Reserved for internal use. Sets the class type of the entity returned by the query.

Parameters:

clazzType - The java.lang.Class implementing TableEntity that represents the entity type for the query.

setPartitionKey

protected void setPartitionKey(final String partitionKey)

Reserved for internal use. Sets the PartitionKey value for the entity to retrieve.

Parameters:

partitionKey - A String containing the PartitionKey value for the entity.

setPrimaryOnlyRetrieve

protected void setPrimaryOnlyRetrieve(boolean isPrimaryOnlyRetrieve)

Parameters:

isPrimaryOnlyRetrieve - the isPrimaryOnlyRetrieve to set

setResolver

protected void setResolver(final EntityResolver resolver)

Reserved for internal use. Sets the resolver to project the entity retrieved as a particular type.

Parameters:

resolver - The EntityResolver<T> instance to use.

setRowKey

protected void setRowKey(final String rowKey)

Reserved for internal use. Sets the RowKey value for the entity to retrieve.

Parameters:

rowKey - A String containing the RowKey value for the entity.

Applies to