Examples of RangeKeyCondition


Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    public void before() throws InterruptedException {
        F_UpdateItemTest.setupData(dynamo);
        new B_PutItemTest().howToPutItems();
        ItemCollection<?> itemCol = dynamo.getTable(TABLE_NAME)
                .query(HASH_KEY_NAME, "foo",
                        new RangeKeyCondition(RANGE_KEY_NAME).between(1, 5));
          int count = 0;
          for (Item item: itemCol) {
              System.out.println(item);
              count++;
          }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    private void verify_BatchWrite_ToOneTable() {
        {   // Verify the 5 items put via the batch operation
            ItemCollection<?> itemCol = dynamo.getTable(TABLE_NAME)
                  .query(HASH_KEY_NAME, "TestingPutItemInBatch",
                          new RangeKeyCondition(RANGE_KEY_NAME).between(111, 555));
            int count = 0;
            for (Item item: itemCol) {
                System.out.println(item);
                count++;
            }
            Assert.assertTrue(count == 5);
        }
        {   // Verify the 5 keys deleted via the batch operation
            ItemCollection<?> itemCol = dynamo.getTable(TABLE_NAME)
                    .query(HASH_KEY_NAME, "foo",
                    new RangeKeyCondition(RANGE_KEY_NAME).between(1, 5));
            int count = 0;
            for (Item item : itemCol) {
                System.out.println(item);
                count++;
            }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    private void verify_BatchWrite_ToMultiTables() {
        {   // Verify the 2 items put to the 1st table via the batch operation
            ItemCollection<?> itemCol = dynamo.getTable(TABLE_NAME)
                  .query(HASH_KEY_NAME, "TestingPutItemInBatch",
                          new RangeKeyCondition(RANGE_KEY_NAME).between(666, 777));
            int count = 0;
            for (Item item: itemCol) {
                System.out.println(item);
                count++;
            }
            Assert.assertTrue(count == 2);
        }
        {   // Verify the 2 keys deleted from the 1st table via the batch operation
            ItemCollection<?> itemCol = dynamo.getTable(TABLE_NAME)
                    .query(HASH_KEY_NAME, "foo",
                    new RangeKeyCondition(RANGE_KEY_NAME).between(1, 2));
            int count = 0;
            for (Item item : itemCol) {
                System.out.println(item);
                count++;
            }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    @Test
    public void simpleQuery() {
        Table table = dynamo.getTable(TABLE_NAME);
        ItemCollection<?> col = table.query(HASH_KEY_NAME, "foo",
            new RangeKeyCondition(RANGE_KEY_NAME).between(1, 10));
        int count = 0;
        for (Item item: col) {
            System.out.println(item);
            count++;
        }
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    @Test
    public void howToUseQueryFilters() {
        Table table = dynamo.getTable(TABLE_NAME);
        ItemCollection<QueryOutcome> col = table.query(HASH_KEY_NAME, "foo",
            new RangeKeyCondition(RANGE_KEY_NAME).between(1, 10),
            new QueryFilter("intAttr").gt(1238));
        int count = 0;
        QueryOutcome lastOutcome = null;
        for (Item item: col) {
            Assert.assertTrue(item.getInt("intAttr") > 1238);
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    @Test
    public void howToUseFilterExpression() {
        Table table = dynamo.getTable(TABLE_NAME);
        ItemCollection<QueryOutcome> col = table.query(
            HASH_KEY_NAME, "foo",
            new RangeKeyCondition(RANGE_KEY_NAME).between(1, 10),
            // filter expression
            "intAttr > :intAttr",
            // no attribute name substitution
            null,    
            // attribute value substitution
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    @Test
    public void howToUseFilterExpression_AttrNameSubstitution() {
        Table table = dynamo.getTable(TABLE_NAME);
        ItemCollection<?> col = table.query(
            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
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

    @Test
    public void howToUseProjectionExpression() {
        Table table = dynamo.getTable(TABLE_NAME);
        ItemCollection<?> col = table.query(
            HASH_KEY_NAME, "foo",
            new RangeKeyCondition(RANGE_KEY_NAME).between(1, 10),
            // filter expression
            "#intAttr > :intAttr",
            // projection expression
            "intAttr, #binary",
            // attribute name substitution
View Full Code Here

Examples of com.amazonaws.services.dynamodbv2.document.RangeKeyCondition

                new Condition()
                .withComparisonOperator(ComparisonOperator.EQ)
                .withAttributeValueList(InternalUtils.toAttributeValue(hashKey.getValue()))
        );
        // range key condition
        RangeKeyCondition rangeKeyCond = spec.getRangeKeyCondition();
        if (rangeKeyCond != null) {
            KeyConditions keyCond = rangeKeyCond.getKeyCondition();
            if (keyCond == null)
                throw new IllegalArgumentException("key condition not specified in range key condition");
            Object[] values = rangeKeyCond.getValues();
            if (values == null)
                throw new IllegalArgumentException("key condition values not specified in range key condition");
            req.addKeyConditionsEntry(rangeKeyCond.getAttrName(),
                    new Condition()
                    .withComparisonOperator(keyCond.toComparisonOperator())
                    .withAttributeValueList(InternalUtils.toAttributeValues(values))
            );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.