Search in sources :

Example 6 with DeleteItemRequest

use of com.amazonaws.services.dynamodbv2.model.DeleteItemRequest in project aws-doc-sdk-examples by awsdocs.

the class StreamsAdapterDemoHelper method deleteItem.

public static void deleteItem(AmazonDynamoDB dynamoDBClient, String tableName, String id) {
    java.util.Map<String, AttributeValue> key = new HashMap<String, AttributeValue>();
    key.put("Id", new AttributeValue().withN(id));
    DeleteItemRequest deleteItemRequest = new DeleteItemRequest().withTableName(tableName).withKey(key);
    dynamoDBClient.deleteItem(deleteItemRequest);
}
Also used : AttributeValue(com.amazonaws.services.dynamodbv2.model.AttributeValue) HashMap(java.util.HashMap) DeleteItemRequest(com.amazonaws.services.dynamodbv2.model.DeleteItemRequest)

Aggregations

DeleteItemRequest (com.amazonaws.services.dynamodbv2.model.DeleteItemRequest)6 AttributeValue (com.amazonaws.services.dynamodbv2.model.AttributeValue)4 DeleteItemResult (com.amazonaws.services.dynamodbv2.model.DeleteItemResult)4 HashMap (java.util.HashMap)3 AmazonDynamoDB (com.amazonaws.services.dynamodbv2.AmazonDynamoDB)2 AmazonClientException (com.amazonaws.AmazonClientException)1 AmazonServiceException (com.amazonaws.AmazonServiceException)1 ReturnValue (com.amazonaws.services.dynamodbv2.model.ReturnValue)1 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 ToString (lombok.ToString)1