Class TableKeysAndAttributes


  • public class TableKeysAndAttributes
    extends Object
    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 Detail

      • TableKeysAndAttributes

        public TableKeysAndAttributes​(String tableName)
    • Method Detail

      • getPrimaryKeys

        public List<PrimaryKey> getPrimaryKeys()
        Return the list of primary keys (of the current table) to be included in a batch get-item operation.
      • withPrimaryKeys

        public TableKeysAndAttributes withPrimaryKeys​(PrimaryKey... primaryKeys)
        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

        public TableKeysAndAttributes withHashOnlyKeys​(String hashKeyName,
                                                       Object... hashKeyValues)
        Used to specify multiple hash-only primary keys.
        Parameters:
        hashKeyName - hash-only key name
        hashKeyValues - 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 name
        rangeKeyName - range key name
        alternatingHashAndRangeKeyValues - a list of alternating hash key value and range key value
      • addPrimaryKey

        public TableKeysAndAttributes addPrimaryKey​(PrimaryKey primaryKey)
        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

        public TableKeysAndAttributes addHashOnlyPrimaryKey​(String hashKeyName,
                                                            Object hashKeyValue)
        Adds a hash-only primary key to be included in the batch get-item operation.
        Parameters:
        hashKeyName - name of the hash key attribute name
        hashKeyValue - name of the hash key value
        Returns:
        the current instance for method chaining purposes
      • addHashOnlyPrimaryKeys

        public TableKeysAndAttributes addHashOnlyPrimaryKeys​(String hashKeyName,
                                                             Object... hashKeyValues)
        Adds multiple hash-only primary keys to be included in the batch get-item operation.
        Parameters:
        hashKeyName - name of the hash key attribute name
        hashKeyValues - 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 name
        rangeKeyName - name of the range key attribute name
        alternatingHashRangeKeyValues - 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 name
        hashKeyValue - hash key value
        rangeKeyName - range key attribute name
        rangeKeyValue - range key value
        Returns:
        the current instance for method chaining purposes
      • withAttributeNames

        public TableKeysAndAttributes withAttributeNames​(String... attributeNames)
        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
      • getAttributeNames

        public Set<String> getAttributeNames()
      • getTableName

        public String getTableName()
      • isConsistentRead

        public boolean isConsistentRead()
      • getProjectionExpression

        public String getProjectionExpression()