Class TableWriteItems

java.lang.Object
com.amazonaws.services.dynamodbv2.document.TableWriteItems

public class TableWriteItems extends Object
Used to specify items to be put and/or primary keys to be deleted from a specific table in a BatchWriteItem request.
  • Constructor Details

    • TableWriteItems

      public TableWriteItems(String tableName)
  • Method Details

    • getPrimaryKeysToDelete

      public List<PrimaryKey> getPrimaryKeysToDelete()
      Return the list of primary keys (of the current table) to be deleted in a batch write operation.
    • withPrimaryKeysToDelete

      public TableWriteItems withPrimaryKeysToDelete(PrimaryKey... primaryKeysToDelete)
      Used to specify multiple primary keys to be deleted from the current table. 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.
    • withHashOnlyKeysToDelete

      public TableWriteItems withHashOnlyKeysToDelete(String hashKeyName, Object... hashKeyValues)
      Used to specify multiple hash-only primary keys to be deleted from the current table.
      Parameters:
      hashKeyName - hash-only key name
      hashKeyValues - a list of hash key values
    • withHashAndRangeKeysToDelete

      public TableWriteItems withHashAndRangeKeysToDelete(String hashKeyName, String rangeKeyName, Object... alternatingHashAndRangeKeyValues)
      Used to specify multiple hash-and-range primary keys to be deleted from the current table.
      Parameters:
      hashKeyName - hash key name
      rangeKeyName - range key name
      alternatingHashAndRangeKeyValues - a list of alternating hash key value and range key value
    • addPrimaryKeyToDelete

      public TableWriteItems addPrimaryKeyToDelete(PrimaryKey primaryKey)
      Adds a primary key to be deleted in a batch write-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.
    • addHashOnlyPrimaryKeyToDelete

      public TableWriteItems addHashOnlyPrimaryKeyToDelete(String hashKeyName, Object hashKeyValue)
      Adds a hash-only primary key to be deleted in a batch write 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
    • addHashOnlyPrimaryKeysToDelete

      public TableWriteItems addHashOnlyPrimaryKeysToDelete(String hashKeyName, Object... hashKeyValues)
      Adds multiple hash-only primary keys to be deleted in a batch write operation.
      Parameters:
      hashKeyName - name of the hash key attribute name
      hashKeyValues - multiple hash key values
      Returns:
      the current instance for method chaining purposes
    • addHashAndRangePrimaryKeysToDelete

      public TableWriteItems addHashAndRangePrimaryKeysToDelete(String hashKeyName, String rangeKeyName, Object... alternatingHashRangeKeyValues)
      Adds multiple hash-and-range primary keys to be deleted in a batch write 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
    • addHashAndRangePrimaryKeyToDelete

      public TableWriteItems addHashAndRangePrimaryKeyToDelete(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue)
      Adds a primary key (that consists of a hash-key and a range-key) to be deleted in a batch write 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
    • withItemsToPut

      public TableWriteItems withItemsToPut(Item... itemsToPut)
      Used to specify the items to be put in the current table in a batch write operation.
      Returns:
      the current instance for method chaining purposes
    • withItemsToPut

      public TableWriteItems withItemsToPut(Collection<Item> itemsToPut)
      Used to specify the collection of items to be put in the current table in a batch write operation.
      Returns:
      the current instance for method chaining purposes
    • getItemsToPut

      public Collection<Item> getItemsToPut()
      Returns the collection of items to be put in the current table in a batch write operation.
    • getTableName

      public String getTableName()
    • addItemToPut

      public TableWriteItems addItemToPut(Item item)
      Adds an item to be put to the current table in a batch write operation.