Interface Table

  • All Known Implementing Classes:
    ReTable

    @Immutable
    public interface Table
    Amazon DynamoDB table abstraction.

    To get data from the table use frame() method. To create a new item in the table (or replace the existing one) use Table#put(Attributes) method. For example:

     Region region = new Region.Simple(...);
     Table table = region.table("employees");
     table.put(new Attributes().with("name", "John Smith"));
     for (Item item : table.frame()) {
       System.out.println("Name: " + item.get("name").getS());
     }
     table.frame()
       .where("name", Conditions.equalTo("John Smith"))
       .iterator().next().remove();
    Since:
    0.1
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void delete​(Map<String,​com.amazonaws.services.dynamodbv2.model.AttributeValue> attributes)
      Delete item from aws table.
      Frame frame()
      Make a new frame, in order to retrieve items.
      String name()
      Get real table name.
      Item put​(Map<String,​com.amazonaws.services.dynamodbv2.model.AttributeValue> attributes)
      Put new item there.
      Region region()
      Get back to the entire region.
    • Method Detail

      • put

        Item put​(Map<String,​com.amazonaws.services.dynamodbv2.model.AttributeValue> attributes)
          throws IOException
        Put new item there.

        It is recommended to use Attributes supplementary class, instead of a raw Map.

        Parameters:
        attributes - Attributes to save
        Returns:
        Item just created
        Throws:
        IOException - In case of DynamoDB failure
        See Also:
        Attributes
      • frame

        Frame frame()
        Make a new frame, in order to retrieve items.
        Returns:
        Frame
      • region

        Region region()
        Get back to the entire region.
        Returns:
        Region
      • name

        String name()
        Get real table name.
        Returns:
        Actual name of DynamoDB table
      • delete

        void delete​(Map<String,​com.amazonaws.services.dynamodbv2.model.AttributeValue> attributes)
             throws IOException
        Delete item from aws table.

        It is recommended to use Attributes supplementary class, instead of a raw Map.

        Parameters:
        attributes - Attributes containing item key and value
        Throws:
        IOException - In case of DynamoDB failure
        See Also:
        Attributes