Package com.jcabi.dynamo
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
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").s());
}
table.frame()
.where("name", Conditions.equalTo("John Smith"))
.iterator().next().remove();- Since:
- 0.1
-
Method Details
-
put
Item put(Map<String, software.amazon.awssdk.services.dynamodb.model.AttributeValue> attributes) throws IOExceptionPut new item there.It is recommended to use
Attributessupplementary class, instead of a rawMap.- Parameters:
attributes- Attributes to save- Returns:
- Item just created
- Throws:
IOException- In case of DynamoDB failure- See Also:
-
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, software.amazon.awssdk.services.dynamodb.model.AttributeValue> attributes) throws IOExceptionDelete item from aws table.It is recommended to use
Attributessupplementary class, instead of a rawMap.- Parameters:
attributes- Attributes containing item key and value- Throws:
IOException- In case of DynamoDB failure- See Also:
-