Package com.amazonaws.services.dynamodbv2.model

Examples of com.amazonaws.services.dynamodbv2.model.PutItemResult


                }

                @Override
                protected void executeLowLevelRequest(boolean onlyKeyAttributeSpecified) {
                    /* Send a putItem request */
                    db.putItem(applyUserAgent(new PutItemRequest().withTableName(getTableName())
                            .withItem(transformAttributes(this.clazz, convertToItem(getAttributeValueUpdates())))
                            .withExpected(getExpectedAttributeValues())));
                }
            };
        } else {
View Full Code Here


            Object rangeGetterResult = safeInvoke(rangeKeyGetter, object);
            attributes.put(rangeKeyAttributeName, getSimpleAttributeValue(rangeKeyGetter, rangeGetterResult));
            expectedValues.put(rangeKeyAttributeName, new ExpectedAttributeValue().withExists(false));
        }
        attributes = transformAttributes(clazz, attributes);
        db.putItem(applyUserAgent(new PutItemRequest().withTableName(tableName).withItem(attributes)
                .withExpected(expectedValues)));
    }
View Full Code Here

                }

                @Override
                protected void executeLowLevelRequest(boolean onlyKeyAttributeSpecified) {
                    /* Send a putItem request */
                    db.putItem(applyUserAgent(new PutItemRequest().withTableName(getTableName())
                            .withItem(transformAttributes(this.clazz, convertToItem(getAttributeValueUpdates())))
                            .withExpected(getExpectedAttributeValues())));
                }
            };
        } else {
View Full Code Here

            Object rangeGetterResult = safeInvoke(rangeKeyGetter, object);
            attributes.put(rangeKeyAttributeName, getSimpleAttributeValue(rangeKeyGetter, rangeGetterResult));
            expectedValues.put(rangeKeyAttributeName, new ExpectedAttributeValue().withExists(false));
        }
        attributes = transformAttributes(clazz, attributes);
        db.putItem(applyUserAgent(new PutItemRequest().withTableName(tableName).withItem(attributes)
                .withExpected(expectedValues)));
    }
View Full Code Here

            System.out.println("Table Description: " + tableDescription);

            // Add an item
            Map<String, AttributeValue> item = newItem("Bill & Ted's Excellent Adventure", 1989, "****", "James", "Sara");
            PutItemRequest putItemRequest = new PutItemRequest(tableName, item);
            PutItemResult putItemResult = dynamoDB.putItem(putItemRequest);
            System.out.println("Result: " + putItemResult);

            // Add another item
            item = newItem("Airplane", 1980, "*****", "James", "Billy Bob");
            putItemRequest = new PutItemRequest(tableName, item);
View Full Code Here

            .withConditionExpression(spec.getConditionExpression())
            .withExpected(expectedMap)
            .withExpressionAttributeNames(spec.getNameMap())
            .withExpressionAttributeValues(attrValMap)
            ;
        PutItemResult result = getClient().putItem(req);
        return new PutItemOutcome(result);
    }
View Full Code Here

    AttributeValue geohashValue = new AttributeValue().withN(Long.toString(geohash));
    putItemRequest.getItem().put(config.getGeohashAttributeName(), geohashValue);
    AttributeValue geoJsonValue = new AttributeValue().withS(geoJson);
    putItemRequest.getItem().put(config.getGeoJsonAttributeName(), geoJsonValue);

    PutItemResult putItemResult = config.getDynamoDBClient().putItem(putItemRequest);
    PutPointResult putPointResult = new PutPointResult(putItemResult);

    return putPointResult;
  }
View Full Code Here

    @Test
    public void putItemWithHashKey() {
        createGenericTable(tableName);

        PutItemRequest request = new PutItemRequest().withTableName(tableName).withItem(createGenericItem());
        PutItemResult res = getClient().putItem(request);

        Assert.assertNotNull(res);
        Assert.assertNotNull(res.getConsumedCapacity());
        Assert.assertEquals(tableName, res.getConsumedCapacity().getTableName());
        Assert.assertNotNull(res.getConsumedCapacity().getCapacityUnits());
    }
View Full Code Here

    public void putItemWithHashKeyOverwriteItem() {
        createGenericTable(tableName);

        PutItemRequest request = new PutItemRequest().withTableName(tableName).withItem(createGenericItem());
        getClient().putItem(request); // put item beforehand
        PutItemResult res = getClient().putItem(request); // Add another

        Assert.assertNotNull(res);
        Assert.assertNotNull(res.getConsumedCapacity());
        Assert.assertEquals(tableName, res.getConsumedCapacity().getTableName());
        Assert.assertNotNull(res.getConsumedCapacity().getCapacityUnits());
    }
View Full Code Here

    @Test
    public void putItemWithHashKeyAndRangeKey() {
        createGenericHashRangeTable(tableName);

        PutItemRequest request = new PutItemRequest().withTableName(tableName).withItem(createGenericItem());
        PutItemResult res = getClient().putItem(request);

        Assert.assertNotNull(res);
        Assert.assertNotNull(res.getConsumedCapacity());
        Assert.assertEquals(tableName, res.getConsumedCapacity().getTableName());
        Assert.assertNotNull(res.getConsumedCapacity().getCapacityUnits());
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.model.PutItemResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.