public class GetItemRequest extends com.amazonaws.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()
A value that if set to
true , then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used. |
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()
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
String |
getTableName()
The name of the table containing the requested item.
|
int |
hashCode() |
Boolean |
isConsistentRead()
A value that if set to
true , then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used. |
void |
setAttributesToGet(Collection<String> attributesToGet)
|
void |
setConsistentRead(Boolean consistentRead)
A value that if set to
true , then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used. |
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)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
void |
setReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
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)
A value that if set to
true , then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used. |
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)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
GetItemRequest |
withReturnConsumedCapacity(String returnConsumedCapacity)
A value that if set to
TOTAL , the response includes
ConsumedCapacity data for tables and indexes. |
GetItemRequest |
withTableName(String tableName)
The name of the table containing the requested item.
|
copyBaseTo, copyPrivateRequestParameters, getCustomRequestHeaders, getGeneralProgressListener, getReadLimit, getRequestClientOptions, getRequestCredentials, getRequestMetricCollector, putCustomRequestHeader, setGeneralProgressListener, setRequestCredentials, setRequestMetricCollector, withGeneralProgressListener, withRequestMetricCollector
public 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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
consistentRead
- A value that if set to true
, then
the operation uses strongly consistent reads; otherwise, eventually
consistent reads are used.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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
public void setKey(Map<String,AttributeValue> key)
For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
public GetItemRequest withKey(Map<String,AttributeValue> key)
For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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)IllegalArgumentException
public 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 hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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)IllegalArgumentException
public GetItemRequest addKeyEntry(String key, AttributeValue value)
For the primary key, you must provide all of the attributes. For example, with a hash type primary key, you only need to provide the hash attribute. For a hash-and-range type primary key, you must provide both the hash attribute and the range attribute.
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()
There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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 -
There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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)
There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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
- There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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)
There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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
- There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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)
There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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
- There is a newer parameter available. Use ProjectionExpression instead. Note that if you use AttributesToGet and ProjectionExpression at the same time, 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, eventually consistent reads are
used.true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.public void setConsistentRead(Boolean consistentRead)
true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.consistentRead
- A value that if set to true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.public GetItemRequest withConsistentRead(Boolean consistentRead)
true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.
Returns a reference to this object so that method calls can be chained together.
consistentRead
- A value that if set to true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.public Boolean getConsistentRead()
true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.true
, then the operation uses
strongly consistent reads; otherwise, eventually consistent reads are
used.public String getReturnConsumedCapacity()
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public void setReturnConsumedCapacity(String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(String returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not 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
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public void setReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.
Constraints:
Allowed Values: INDEXES, TOTAL, NONE
returnConsumedCapacity
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public GetItemRequest withReturnConsumedCapacity(ReturnConsumedCapacity returnConsumedCapacity)
TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not 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
- A value that if set to TOTAL
, the response includes
ConsumedCapacity data for tables and indexes. If set to
INDEXES
, the response includes ConsumedCapacity
for indexes. If set to NONE
(the default),
ConsumedCapacity is not included in the response.ReturnConsumedCapacity
public 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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to Accessing Item Attributes in the Amazon DynamoDB Developer Guide.
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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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, go to 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 Object
Object.toString()
Copyright © 2015. All rights reserved.