.withTableName(tableName).withExpected(internalAssertions) .withRequestMetricCollector(config.getRequestMetricCollector()); req = req.withExpected( mergeExpectedAttributeValueConditions(internalAssertions, deleteExpression.getExpected(),
private DeleteItemOutcome doDeleteItem(DeleteItemSpec spec) { // set the table name final String tableName = getTable().getTableName(); // set up the keys DeleteItemRequest req = spec.getRequest().withTableName(tableName) .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents())); // set up the expected attribute map, if any final Collection<Expected> expected = spec.getExpected(); final Map<String, ExpectedAttributeValue> expectedMap = InternalUtils.toExpectedAttributeValueMap(expected); // set up the value map, if any (when expression API is used) final Map<String,AttributeValue> attrValMap = InternalUtils.fromSimpleMap(spec.getValueMap()); // set up the request req.withExpected(expectedMap) .withExpressionAttributeNames(spec.getNameMap()) .withExpressionAttributeValues(attrValMap) ; DeleteItemResult result = getClient().deleteItem(req); return new DeleteItemOutcome(result); }
.withTableName(tableName).withExpected(internalAssertions) .withRequestMetricCollector(config.getRequestMetricCollector()); req = req.withExpected( mergeExpectedAttributeValueConditions(internalAssertions, deleteExpression.getExpected(),
/** * Deletes the tx item, only if it was in the "finalized" state. * * @throws ConditionalCheckFailedException if the item does not exist or is not finalized */ public void delete() throws ConditionalCheckFailedException { Map<String, ExpectedAttributeValue> expected = new HashMap<String, ExpectedAttributeValue>(1); expected.put(AttributeName.FINALIZED.toString(), new ExpectedAttributeValue().withValue(new AttributeValue(Transaction.BOOLEAN_TRUE_ATTR_VAL))); DeleteItemRequest completeRequest = new DeleteItemRequest() .withTableName(txManager.getTransactionTableName()) .withKey(txKey) .withExpected(expected); txManager.getClient().deleteItem(completeRequest); }
ReturnConsumedCapacity.TOTAL .withExpected( new Attributes(item).only(this.keys).asKeys()
ReturnConsumedCapacity.TOTAL .withExpected( new Attributes(item).only(this.keys).asKeys()
.withTableName(tableName) .withKey(key) .withExpected(expected); txManager.getClient().deleteItem(delete); } catch (ConditionalCheckFailedException e1) {
.withTableName(tableName).withExpected(internalAssertions) .withRequestMetricCollector(config.getRequestMetricCollector()); req = req.withExpected( mergeExpectedAttributeValueConditions(internalAssertions, deleteExpression.getExpected(),
.withTableName(tableName) .withKey(key) .withExpected(expected); txManager.getClient().deleteItem(delete); return;
.withTableName(request.getTableName()) .withKey(request.getKey(txManager)) .withExpected(expected); txManager.getClient().deleteItem(delete); } else if(request instanceof GetItem) {
private DeleteItemOutcome doDeleteItem(DeleteItemSpec spec) { // set the table name final String tableName = getTable().getTableName(); // set up the keys DeleteItemRequest req = spec.getRequest().withTableName(tableName) .withKey(InternalUtils.toAttributeValueMap(spec.getKeyComponents())); // set up the expected attribute map, if any final Collection<Expected> expected = spec.getExpected(); final Map<String, ExpectedAttributeValue> expectedMap = InternalUtils.toExpectedAttributeValueMap(expected); // set up the value map, if any (when expression API is used) final Map<String,AttributeValue> attrValMap = InternalUtils.fromSimpleMap(spec.getValueMap()); // set up the request req.withExpected(expectedMap) .withExpressionAttributeNames(spec.getNameMap()) .withExpressionAttributeValues(attrValMap) ; DeleteItemResult result = getClient().deleteItem(req); return new DeleteItemOutcome(result); }