/** * Save the item using a PutItem request. The handler will call this * method if * <ul> * <li> CLOBBER configuration is being used; * <li> OR the item contains auto-generated key value; * <li> OR an UpdateItem request has silently failed (200 response with * no affected attribute), which indicates the key-only-put scenario * that we used to handle by the keyOnlyPut(...) hack. * </ul> */ protected PutItemResult doPutItem() { Map<String, AttributeValue> attributeValues = convertToItem(getAttributeValueUpdates()); attributeValues = transformAttributes( toParameters(attributeValues, this.clazz, getTableName(), saveConfig)); PutItemRequest req = new PutItemRequest() .withTableName(getTableName()) .withItem(attributeValues) .withExpected(mergeExpectedAttributeValueConditions()) .withConditionalOperator(userProvidedConditionOperator) .withRequestMetricCollector(saveConfig.getRequestMetricCollector()); return db.putItem(applyUserAgent(req)); }
/** * Save the item using a PutItem request. The handler will call this * method if * <ul> * <li>CLOBBER configuration is being used; * <li>OR the item contains auto-generated key value; * <li>OR an UpdateItem request has silently failed (200 response with * no affected attribute), which indicates the key-only-put scenario * that we used to handle by the keyOnlyPut(...) hack. * </ul> */ protected PutItemResult doPutItem() { Map<String, AttributeValue> attributeValues = convertToItem(getAttributeValueUpdates()); attributeValues = transformAttributes( toParameters(attributeValues, this.clazz, getTableName(), saveConfig)); final PutItemRequest req = new PutItemRequest() .withTableName(getTableName()) .withItem(attributeValues) .withExpected(mergeExpectedAttributeValueConditions()) .withConditionalOperator(userProvidedConditionOperator) .withRequestMetricCollector(saveConfig.getRequestMetricCollector()); return db.putItem(applyUserAgent(req)); }
/** * Save the item using a PutItem request. The handler will call this * method if * <ul> * <li> CLOBBER configuration is being used; * <li> OR the item contains auto-generated key value; * <li> OR an UpdateItem request has silently failed (200 response with * no affected attribute), which indicates the key-only-put scenario * that we used to handle by the keyOnlyPut(...) hack. * </ul> */ protected PutItemResult doPutItem() { Map<String, AttributeValue> attributeValues = convertToItem(getAttributeValueUpdates()); attributeValues = transformAttributes( toParameters(attributeValues, this.clazz, getTableName(), saveConfig)); PutItemRequest req = new PutItemRequest() .withTableName(getTableName()) .withItem(attributeValues) .withExpected(mergeExpectedAttributeValueConditions()) .withConditionalOperator(userProvidedConditionOperator) .withRequestMetricCollector(saveConfig.getRequestMetricCollector()); return db.putItem(applyUserAgent(req)); }