Package com.amazonaws.services.dynamodbv2.model

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


        getClient().updateItem(update);

        inProcessClient.save(PERSISTENCE_PATH);
        createNewInProcessClient().restore(PERSISTENCE_PATH);

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;
        QueryResult result = getClient().query(request);
        Assert.assertNotNull(result.getItems());
View Full Code Here


        getClient().updateItem(update);

        inProcessClient.save(PERSISTENCE_PATH);
        createNewInProcessClient().restore(PERSISTENCE_PATH);

        QueryRequest request = new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey));
        QueryResult result = getClient().query(request);

        assertNotNull(result.getItems());
View Full Code Here

        getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));

        inProcessClient.save(PERSISTENCE_PATH);
        createNewInProcessClient().restore(PERSISTENCE_PATH);

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;
        QueryResult result = getClient().query(request);
        Assert.assertNotNull(result.getItems());
View Full Code Here

        AttributeValue hashKey = setupTableWithSeveralItems();

        inProcessClient.save(PERSISTENCE_PATH);
        createNewInProcessClient().restore(PERSISTENCE_PATH);

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;

        Condition rangeKeyCondition = new Condition();
        List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
        attributeValueList.add(createStringAttribute("Range2"));
        rangeKeyCondition.setAttributeValueList(attributeValueList);
        rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
        request.getKeyConditions().put("range", rangeKeyCondition);

        QueryResult result = getClient().query(request);

        Assert.assertNotNull("Null result.", result);
        Assert.assertNotNull("No items returned.", result.getItems());
View Full Code Here

    getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));
    getClient().putItem(new PutItemRequest().withItem(createGenericItem(hashKey)).withTableName(tableName));
    getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));
    getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;
    QueryResult result = getClient().query(request);
View Full Code Here

        AttributeValue hashKey = createStringAttribute();
        getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));
        getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));
        getClient().putItem(new PutItemRequest().withItem(createGenericItem()).withTableName(tableName));

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;
        Assert.assertNotNull(request);
View Full Code Here

    @Test
  public void queryWithHashKeyAndAttributesToGetTest() {
        AttributeValue hashKey = setupTableWithSeveralItems();

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;

    List<String> attrToGet = new ArrayList<String>();
    attrToGet.add("range");
    attrToGet.add("attr1");
    attrToGet.add("bogusAttr");
    request.setAttributesToGet(attrToGet);

        QueryResult result = getClient().query(request);

        Assert.assertNotNull(result);
    Assert.assertNotNull(result.getItems());
View Full Code Here

  @Test
  public void queryWithHashKeyAndRangeKeyConditionEQTest() {
        AttributeValue hashKey = setupTableWithSeveralItems();

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;

    Condition rangeKeyCondition = new Condition();
    List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//    attributeValueList.add(new AttributeValue().withN("1"));
    attributeValueList.add(createStringAttribute("Range2"));
    rangeKeyCondition.setAttributeValueList(attributeValueList);
    rangeKeyCondition.setComparisonOperator(ComparisonOperator.EQ);
    request.getKeyConditions().put("range", rangeKeyCondition);

        QueryResult result = getClient().query(request);

        Assert.assertNotNull("Null result.", result);
    Assert.assertNotNull("No items returned.", result.getItems());
View Full Code Here

  @Test
  public void queryWithHashKeyAndRangeKeyConditionLTTest() {
        AttributeValue hashKey = setupTableWithSeveralItems();

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;

    Condition rangeKeyCondition = new Condition();
    List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//    attributeValueList.add(new AttributeValue().withN("1"));
    attributeValueList.add(createStringAttribute("Range2"));
    rangeKeyCondition.setAttributeValueList(attributeValueList);
    rangeKeyCondition.setComparisonOperator(ComparisonOperator.LT);
    request.getKeyConditions().put("range", rangeKeyCondition);

        QueryResult result = getClient().query(request);

        Assert.assertNotNull("Null result.", result);
    Assert.assertNotNull("No items returned.", result.getItems());
View Full Code Here

  @Test
  public void queryWithHashKeyAndRangeKeyConditionLETest() {
        AttributeValue hashKey = setupTableWithSeveralItems();

        QueryRequest request =
            new QueryRequest()
                .withTableName(tableName)
                .withKeyConditions(createHashKeyCondition("id", hashKey))
                ;

    Condition rangeKeyCondition = new Condition();
    List<AttributeValue> attributeValueList = new ArrayList<AttributeValue>();
//    attributeValueList.add(new AttributeValue().withN("1"));
    attributeValueList.add(createStringAttribute("Range2"));
    rangeKeyCondition.setAttributeValueList(attributeValueList);
    rangeKeyCondition.setComparisonOperator(ComparisonOperator.LE);
    request.getKeyConditions().put("range", rangeKeyCondition);

        QueryResult result = getClient().query(request);

        Assert.assertNotNull("Null result.", result);
    Assert.assertNotNull("No items returned.", result.getItems());
View Full Code Here

TOP

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

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.