Package com.amazonaws.services.dynamodbv2.document.utils

Examples of com.amazonaws.services.dynamodbv2.document.utils.NameMap


            new TableKeysAndAttributes(TABLE_NAME)
            // use projection expression instead of attribute names
            .withProjectionExpression(
                HASH_KEY_NAME + ", " + RANGE_KEY_NAME + ", "
              + "#binary, booleanTrue, intAttr, mapAttr, stringSetAttr")
            .withNameMap(new NameMap().with("#binary", "binary"))
            // you can add a bunch of keys in one go
            .addHashAndRangePrimaryKeys(
                HASH_KEY_NAME, RANGE_KEY_NAME,
                "foo",          2,
                "foo",          3,
View Full Code Here


                // Here is the projection expression to select 3 attributes
                // to be returned.
                // This expression requires attribute name substitution for
                // "binary" which is a reserved word in DynamoDB
                "#binary, intAttr, stringAttr",
                new NameMap().with("#binary", "binary"));
            Item item = outcome.getItem();
            System.out.println("========== item " + i + " ==========");
            System.out.println(item);
            byte[] binary = item.getBinary("binary");
            System.out.println("binary: " + Arrays.toString(binary));
View Full Code Here

        Table table = dynamo.getTable(TABLE_NAME);
        for (int i=1; i <= 10; i++) {
            GetItemOutcome outcome = table.getItemOutcome(new GetItemSpec()
                .withPrimaryKey(HASH_KEY_NAME, "foo", RANGE_KEY_NAME, i)
                .withProjectionExpression("#binary, intAttr, stringAttr")
                .withNameMap(new NameMap().with("#binary", "binary")));
            Item item = outcome.getItem();
            System.out.println("========== item " + i + " ==========");
            System.out.println(item);
            byte[] binary = item.getBinary("binary");
            System.out.println("binary: " + Arrays.toString(binary));
View Full Code Here

    public void howToUseUpdateExpression() {
        Table table = dynamo.getTable(TABLE_NAME);
        table.updateItem(HASH_KEY, FIRST_CUSTOMER_ID, RANGE_KEY, ADDRESS_TYPE_WORK,
            // update expression
            "set #phoneAttributeName = :phoneAtributeValue",
            new NameMap().with("#phoneAttributeName", "phone"),
            new ValueMap().withStringSet(":phoneAtributeValue",
                "123-456-7890", "987-654-3210")
            );
        GetItemOutcome outcome = table.getItemOutcome(new GetItemSpec()
            .withPrimaryKey(HASH_KEY, FIRST_CUSTOMER_ID, RANGE_KEY, ADDRESS_TYPE_WORK)
View Full Code Here

            // filter expression
              "myHashKey = :myHashKey AND "
            + "#myRangeKey BETWEEN :lo and :hi AND "
            + "intAttr > :intAttr",
            // attribute name substitution
            new NameMap().with("#myRangeKey", "myRangeKey"),
            // attribute value substitution
            new ValueMap()
                .withString(":myHashKey", "foo")
                .withInt(":lo", 1).withInt(":hi", 10)
                .withInt(":intAttr", 1238)
View Full Code Here

            + "#myRangeKey BETWEEN :lo and :hi AND "
            + "intAttr > :intAttr",
            // projection expression
            "intAttr, #binary",
            // attribute name substitution
            new NameMap()
                .with("#myRangeKey", "myRangeKey")
                .with("#binary", "binary"),
            // attribute value substitution
            new ValueMap()
                .withString(":myHashKey", "foo")
View Full Code Here

            HASH_KEY_NAME, "foo",
            new RangeKeyCondition(RANGE_KEY_NAME).between(1, 10),
            // filter expression with name substitution
            "#intAttr > :intAttr",
            // attribute name substitution
            new NameMap().with("#intAttr", "intAttr"),
            // attribute value substitution
            new ValueMap().withInt(":intAttr", 1238));
        int count = 0;
        for (Item item: col) {
            Assert.assertTrue(item.getInt("intAttr") > 1238);
View Full Code Here

            // filter expression
            "#intAttr > :intAttr",
            // projection expression
            "intAttr, #binary",
            // attribute name substitution
            new NameMap()
                .with("#intAttr", "intAttr")
                .with("#binary", "binary"),
            // attribute value substitution
            new ValueMap().withInt(":intAttr", 1238));
        int count = 0;
View Full Code Here

                // Here is the projection expression to select 3 attributes
                // to be returned.
                // This expression requires attribute name substitution for
                // "binary" which is a reserved word in DynamoDB
                "#binary, intAttr, stringAttr",
                new NameMap().with("#binary", "binary"));
            System.out.println("========== item " + i + " ==========");
            System.out.println(item);
            byte[] binary = item.getBinary("binary");
            System.out.println("binary: " + Arrays.toString(binary));
            int intval = item.getInt("intAttr");
View Full Code Here

        Table table = dynamo.getTable(TABLE_NAME);
        for (int i=1; i <= 10; i++) {
            Item item = table.getItem(new GetItemSpec()
                .withPrimaryKey(HASH_KEY_NAME, "foo", RANGE_KEY_NAME, i)
                .withProjectionExpression("#binary, intAttr, stringAttr")
                .withNameMap(new NameMap().with("#binary", "binary")));
            System.out.println("========== item " + i + " ==========");
            System.out.println(item);
            byte[] binary = item.getBinary("binary");
            System.out.println("binary: " + Arrays.toString(binary));
            int intval = item.getInt("intAttr");
View Full Code Here

TOP

Related Classes of com.amazonaws.services.dynamodbv2.document.utils.NameMap

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.