Example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapper batchDelete

List of usage examples for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapper batchDelete

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.datamodeling DynamoDBMapper batchDelete.

Prototype

@Override
    public List<FailedBatch> batchDelete(Iterable<? extends Object> objectsToDelete) 

Source Link

Usage

From source file:com.github.sporcina.mule.modules.DynamoDBConnector.java

License:Open Source License

/**
 * Processor to delete a document//  ww w.j a  v a 2 s.  c  om
 * <p/>
 * {@sample.xml ../../../doc/DynamoDB-connector.xml.sample dynamodb:delete-all-documents}
 *
 * @param tableName
 *         the name of the table to get the document from
 * @param template
 *         the object to use as a document.  If not explicitly provided, it defaults to PAYLOAD.
 */
@Processor
public void deleteAllDocuments(String tableName, @Optional @Default(PAYLOAD) final Object template) {
    List<Object> documents = (List<Object>) getAllDocuments(tableName, template);
    DynamoDBMapper mapper = getDbObjectMapper(tableName);
    mapper.batchDelete(documents);
}