Example usage for com.amazonaws.services.dynamodbv2.document Table deleteItem

List of usage examples for com.amazonaws.services.dynamodbv2.document Table deleteItem

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document Table deleteItem.

Prototype

@Override
    public DeleteItemOutcome deleteItem(DeleteItemSpec spec) 

Source Link

Usage

From source file:com.clicktravel.infrastructure.persistence.aws.dynamodb.DynamoDocumentStoreTemplate.java

License:Apache License

@Override
public void delete(final Item item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers) {
    final ItemConfiguration itemConfiguration = getItemConfiguration(item.getClass());
    final String tableName = databaseSchemaHolder.schemaName() + "." + itemConfiguration.tableName();
    final DeleteItemSpec deleteItemSpec = new DeleteItemSpec()
            .withPrimaryKey(getPrimaryKey(itemConfiguration.getItemId(item), itemConfiguration));

    final Table table = dynamoDBClient.getTable(tableName);
    table.deleteItem(deleteItemSpec);

    deleteUniqueConstraintIndexes(item, itemConfiguration);

}