Class TableKeysAndAttributes
java.lang.Object
com.amazonaws.services.dynamodbv2.document.TableKeysAndAttributes
Used to specify one or multiple primary keys of a specific table, the
attributes to be retrieved from that table, and the consistency of the read
operation in a
BatchGetItem
request.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddHashAndRangePrimaryKey
(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue) Adds a primary key (that consists of a hash-key and a range-key) to be included in the batch get-item operation.addHashAndRangePrimaryKeys
(String hashKeyName, String rangeKeyName, Object... alternatingHashRangeKeyValues) Adds multiple hash-and-range primary keys to be included in the batch get-item operation.addHashOnlyPrimaryKey
(String hashKeyName, Object hashKeyValue) Adds a hash-only primary key to be included in the batch get-item operation.addHashOnlyPrimaryKeys
(String hashKeyName, Object... hashKeyValues) Adds multiple hash-only primary keys to be included in the batch get-item operation.addPrimaryKey
(PrimaryKey primaryKey) Adds a primary key to be included in the batch get-item operation.Return the list of primary keys (of the current table) to be included in a batch get-item operation.boolean
withAttrbuteNames
(String... attributeNames) Deprecated.withAttrbuteNames
(List<String> attributeNames) Deprecated.withAttributeNames
(String... attributeNames) Used to specify the attributes to be retrieved in each item returned from the batch get-item operation.withAttributeNames
(List<String> attributeNames) withConsistentRead
(boolean consistentRead) withHashAndRangeKeys
(String hashKeyName, String rangeKeyName, Object... alternatingHashAndRangeKeyValues) Used to specify multiple hash-and-range primary keys.withHashOnlyKeys
(String hashKeyName, Object... hashKeyValues) Used to specify multiple hash-only primary keys.withNameMap
(Map<String, String> nameMap) withPrimaryKeys
(PrimaryKey... primaryKeys) Used to specify multiple primary keys.withProjectionExpression
(String projectionExpression)
-
Constructor Details
-
TableKeysAndAttributes
-
-
Method Details
-
getPrimaryKeys
Return the list of primary keys (of the current table) to be included in a batch get-item operation. -
withPrimaryKeys
Used to specify multiple primary keys. A primary key could consist of either a hash-key or both a hash-key and a range-key depending on the schema of the table. -
withHashOnlyKeys
Used to specify multiple hash-only primary keys.- Parameters:
hashKeyName
- hash-only key namehashKeyValues
- a list of hash key values
-
withHashAndRangeKeys
public TableKeysAndAttributes withHashAndRangeKeys(String hashKeyName, String rangeKeyName, Object... alternatingHashAndRangeKeyValues) Used to specify multiple hash-and-range primary keys.- Parameters:
hashKeyName
- hash key namerangeKeyName
- range key namealternatingHashAndRangeKeyValues
- a list of alternating hash key value and range key value
-
addPrimaryKey
Adds a primary key to be included in the batch get-item operation. A primary key could consist of either a hash-key or both a hash-key and a range-key depending on the schema of the table. -
addHashOnlyPrimaryKey
Adds a hash-only primary key to be included in the batch get-item operation.- Parameters:
hashKeyName
- name of the hash key attribute namehashKeyValue
- name of the hash key value- Returns:
- the current instance for method chaining purposes
-
addHashOnlyPrimaryKeys
Adds multiple hash-only primary keys to be included in the batch get-item operation.- Parameters:
hashKeyName
- name of the hash key attribute namehashKeyValues
- multiple hash key values- Returns:
- the current instance for method chaining purposes
-
addHashAndRangePrimaryKeys
public TableKeysAndAttributes addHashAndRangePrimaryKeys(String hashKeyName, String rangeKeyName, Object... alternatingHashRangeKeyValues) Adds multiple hash-and-range primary keys to be included in the batch get-item operation.- Parameters:
hashKeyName
- name of the hash key attribute namerangeKeyName
- name of the range key attribute namealternatingHashRangeKeyValues
- used to specify multiple alternating hash key and range key values- Returns:
- the current instance for method chaining purposes
-
addHashAndRangePrimaryKey
public TableKeysAndAttributes addHashAndRangePrimaryKey(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue) Adds a primary key (that consists of a hash-key and a range-key) to be included in the batch get-item operation.- Parameters:
hashKeyName
- hash key attribute namehashKeyValue
- hash key valuerangeKeyName
- range key attribute namerangeKeyValue
- range key value- Returns:
- the current instance for method chaining purposes
-
withAttrbuteNames
Deprecated. -
withAttrbuteNames
Deprecated. -
withAttributeNames
Used to specify the attributes to be retrieved in each item returned from the batch get-item operation.- Parameters:
attributeNames
- names of the attributes to be retrieved in each item returned from the batch get-item operation.- Returns:
- the current instance for method chaining purposes
-
withAttributeNames
-
getAttributeNames
-
getTableName
-
isConsistentRead
public boolean isConsistentRead() -
withConsistentRead
-
getProjectionExpression
-
withProjectionExpression
-
getNameMap
-
withNameMap
-
withAttributeNames(String...)
.