public class GetItemRequest extends AmazonWebServiceRequest implements Serializable
GetItem operation.
The GetItem operation returns a set of attributes for the item with the given primary key. If there is no matching item, GetItem does not return any data.
GetItem provides an eventually consistent read by default. If
your application requires a strongly consistent read, set
ConsistentRead to true . Although a strongly
consistent read might take more time than an eventually consistent
read, it always returns the last updated value.
| Constructor and Description |
|---|
GetItemRequest()
Default constructor for a new GetItemRequest object.
|
GetItemRequest(String tableName,
Map<String,AttributeValue> key)
Constructs a new GetItemRequest object.
|
GetItemRequest(String tableName,
Map<String,AttributeValue> key,
Boolean consistentRead)
Constructs a new GetItemRequest object.
|
| Modifier and Type | Method and Description |
|---|---|
GetItemRequest |
addExpressionAttributeNamesEntry(String key,
String value)
One or more substitution tokens for attribute names in an expression.
|
GetItemRequest |
addKeyEntry(String key,
AttributeValue value)
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
GetItemRequest |
clearExpressionAttributeNamesEntries()
Removes all the entries added into ExpressionAttributeNames.
|
GetItemRequest |
clearKeyEntries()
Removes all the entries added into Key.
|
boolean |
equals(Object obj) |
List<String> |
getAttributesToGet()
|
Boolean |
getConsistentRead()
Determines the read consistency model: If set to
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads. |
Map<String,String> |
getExpressionAttributeNames()
One or more substitution tokens for attribute names in an expression.
|
Map<String,AttributeValue> |
getKey()
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
String |
getProjectionExpression()
A string that identifies one or more attributes to retrieve from the
table.
|
String |
getReturnConsumedCapacity()
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
|
String |
getTableName()
The name of the table containing the requested item.
|
int |
hashCode() |
Boolean |
isConsistentRead()
Determines the read consistency model: If set to
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads. |
void |
setAttributesToGet(Collection<String> attributesToGet)
|
void |
setConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads. |
void |
setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression.
|
void |
setKey(Map.Entry<String,AttributeValue> hashKey,
Map.Entry<String,AttributeValue> rangeKey)
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
void |
setKey(Map<String,AttributeValue> key)
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
void |
setProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the
table.
|
void |
setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
|
void |
setReturnConsumedCapacity(String returnConsumedCapacity)
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
|
void |
setTableName(String tableName)
The name of the table containing the requested item.
|
String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
GetItemRequest |
withAttributesToGet(Collection<String> attributesToGet)
|
GetItemRequest |
withAttributesToGet(String... attributesToGet)
|
GetItemRequest |
withConsistentRead(Boolean consistentRead)
Determines the read consistency model: If set to
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads. |
GetItemRequest |
withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
One or more substitution tokens for attribute names in an expression.
|
GetItemRequest |
withKey(Map.Entry<String,AttributeValue> hashKey,
Map.Entry<String,AttributeValue> rangeKey)
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
GetItemRequest |
withKey(Map<String,AttributeValue> key)
A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve.
|
GetItemRequest |
withProjectionExpression(String projectionExpression)
A string that identifies one or more attributes to retrieve from the
table.
|
GetItemRequest |
withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
|
GetItemRequest |
withReturnConsumedCapacity(String returnConsumedCapacity)
Determines the level of detail about provisioned throughput
consumption that is returned in the response:
|
GetItemRequest |
withTableName(String tableName)
The name of the table containing the requested item.
|
getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, setRequestCredentials, setRequestMetricCollector, withRequestMetricCollectorpublic GetItemRequest()
public GetItemRequest(String tableName, Map<String,AttributeValue> key)
tableName - The name of the table containing the requested item.key - A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public GetItemRequest(String tableName, Map<String,AttributeValue> key, Boolean consistentRead)
tableName - The name of the table containing the requested item.key - A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
consistentRead - Determines the read consistency model: If set to
true, then the operation uses strongly consistent reads;
otherwise, the operation uses eventually consistent reads.public String getTableName()
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
public void setTableName(String tableName)
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName - The name of the table containing the requested item.public GetItemRequest withTableName(String tableName)
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 3 - 255
Pattern: [a-zA-Z0-9_.-]+
tableName - The name of the table containing the requested item.public Map<String,AttributeValue> getKey()
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public void setKey(Map<String,AttributeValue> key)
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
key - A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public GetItemRequest withKey(Map<String,AttributeValue> key)
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
Returns a reference to this object so that method calls can be chained together.
key - A map of attribute names to AttributeValue objects,
representing the primary key of the item to retrieve. For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
public void setKey(Map.Entry<String,AttributeValue> hashKey, Map.Entry<String,AttributeValue> rangeKey) throws IllegalArgumentException
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
This method accepts the hashKey, rangeKey of Key as
java.util.Map.Entry
hashKey - Primary hash key.rangeKey - Primary range key. (null if it a hash-only table)IllegalArgumentExceptionpublic GetItemRequest withKey(Map.Entry<String,AttributeValue> hashKey, Map.Entry<String,AttributeValue> rangeKey) throws IllegalArgumentException
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
This method accepts the hashKey, rangeKey of Key as
java.util.Map.Entry
Returns a reference to this object so that method calls can be chained together.
hashKey - Primary hash key.rangeKey - Primary range key. (null if it a hash-only table)IllegalArgumentExceptionpublic GetItemRequest addKeyEntry(String key, AttributeValue value)
For the primary key, you must provide all of the attributes. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.
The method adds a new key-value pair into Key parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into Key.value - The corresponding value of the entry to be added into Key.public GetItemRequest clearKeyEntries()
Returns a reference to this object so that method calls can be chained together.
public List<String> getAttributesToGet()
This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Constraints:
Length: 1 -
This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public void setAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Constraints:
Length: 1 -
attributesToGet - This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public GetItemRequest withAttributesToGet(String... attributesToGet)
This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet - This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public GetItemRequest withAttributesToGet(Collection<String> attributesToGet)
This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Length: 1 -
attributesToGet - This is a legacy parameter, for backward compatibility. New applications should use ProjectionExpression instead. Do not combine legacy parameters and expression parameters in a single API call; otherwise, DynamoDB will return a ValidationException exception.
This parameter allows you to retrieve attributes of type List or Map; however, it cannot retrieve individual elements within a List or a Map.
The names of one or more attributes to retrieve. If no attribute names are provided, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
Note that AttributesToGet has no effect on provisioned throughput consumption. DynamoDB determines capacity units consumed based on item size, not on the amount of data that is returned to an application.
public Boolean isConsistentRead()
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.public void setConsistentRead(Boolean consistentRead)
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.consistentRead - Determines the read consistency model: If set to true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.public GetItemRequest withConsistentRead(Boolean consistentRead)
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.
Returns a reference to this object so that method calls can be chained together.
consistentRead - Determines the read consistency model: If set to true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.public Boolean getConsistentRead()
true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.true,
then the operation uses strongly consistent reads; otherwise, the
operation uses eventually consistent reads.public String getReturnConsumedCapacity()
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
ReturnConsumedCapacitypublic void setReturnConsumedCapacity(String returnConsumedCapacity)
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity - Determines the level of detail about provisioned throughput
consumption that is returned in the response: INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
ReturnConsumedCapacitypublic GetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity - Determines the level of detail about provisioned throughput
consumption that is returned in the response: INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
ReturnConsumedCapacitypublic void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity - Determines the level of detail about provisioned throughput
consumption that is returned in the response: INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
ReturnConsumedCapacitypublic GetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
Returns a reference to this object so that method calls can be chained together.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity - Determines the level of detail about provisioned throughput
consumption that is returned in the response: INDEXES - The response includes the aggregate ConsumedCapacity for the operation, together with ConsumedCapacity for each table and secondary index that was accessed.
Note that some operations, such as GetItem and BatchGetItem, do not access any indexes at all. In these cases, specifying INDEXES will only return ConsumedCapacity information for table(s).
TOTAL - The response includes only the aggregate ConsumedCapacity for the operation.
NONE - No ConsumedCapacity details are included in the response.
ReturnConsumedCapacitypublic String getProjectionExpression()
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
public void setProjectionExpression(String projectionExpression)
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
projectionExpression - A string that identifies one or more attributes to retrieve from the
table. These attributes can include scalars, sets, or elements of a
JSON document. The attributes in the expression must be separated by
commas. If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
public GetItemRequest withProjectionExpression(String projectionExpression)
If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
Returns a reference to this object so that method calls can be chained together.
projectionExpression - A string that identifies one or more attributes to retrieve from the
table. These attributes can include scalars, sets, or elements of a
JSON document. The attributes in the expression must be separated by
commas. If no attribute names are specified, then all attributes will be returned. If any of the requested attributes are not found, they will not appear in the result.
For more information, see Accessing
Item Attributes in the Amazon DynamoDB Developer Guide.
ProjectionExpression replaces the legacy
AttributesToGet parameter.
public Map<String,String> getExpressionAttributeNames()
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
public void setExpressionAttributeNames(Map<String,String> expressionAttributeNames)
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
expressionAttributeNames - One or more substitution tokens for attribute names in an expression.
The following are some use cases for using
ExpressionAttributeNames: To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
public GetItemRequest withExpressionAttributeNames(Map<String,String> expressionAttributeNames)
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
Returns a reference to this object so that method calls can be chained together.
expressionAttributeNames - One or more substitution tokens for attribute names in an expression.
The following are some use cases for using
ExpressionAttributeNames: To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
public GetItemRequest addExpressionAttributeNamesEntry(String key, String value)
To access an attribute whose name conflicts with a DynamoDB reserved word.
To create a placeholder for repeating occurrences of an attribute name in an expression.
To prevent special characters in an attribute name from being misinterpreted in an expression.
Use the # character in an expression to dereference an attribute name. For example, consider the following attribute name:
Percentile
The name of this attribute conflicts with a reserved word, so it cannot be used directly in an expression. (For the complete list of reserved words, see Reserved Words in the Amazon DynamoDB Developer Guide). To work around this, you could specify the following for ExpressionAttributeNames:
{"#P":"Percentile"}
You could then use this substitution in an expression, as in this example:
#P = :val
Tokens that begin with the : character are expression attribute values, which are placeholders for the actual value at runtime.
For more information on expression attribute names, see Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
The method adds a new key-value pair into ExpressionAttributeNames parameter, and returns a reference to this object so that method calls can be chained together.
key - The key of the entry to be added into ExpressionAttributeNames.value - The corresponding value of the entry to be added into ExpressionAttributeNames.public GetItemRequest clearExpressionAttributeNamesEntries()
Returns a reference to this object so that method calls can be chained together.
public String toString()
toString in class ObjectObject.toString()Copyright © 2016. All rights reserved.