Example usage for com.amazonaws.services.dynamodbv2.model QueryResult toString

List of usage examples for com.amazonaws.services.dynamodbv2.model QueryResult toString

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.model QueryResult toString.

Prototype

@Override
public String toString() 

Source Link

Document

Returns a string representation of this object.

Usage

From source file:Database.CustomerData.java

License:Open Source License

public static String QueryCustomer(String customerId) throws Exception {
    String r = null;//from w  ww .j  av  a 2s  .c om
    init();
    try {
        Condition hashKeyCondition = new Condition().withComparisonOperator(ComparisonOperator.EQ)
                .withAttributeValueList(new AttributeValue().withS(customerId));
        Map<String, Condition> keyConditions = new HashMap<String, Condition>();
        keyConditions.put("Id", hashKeyCondition);
        QueryRequest queryRequest = new QueryRequest().withTableName("MemberData")
                .withKeyConditions(keyConditions);
        System.out.println(customerId);
        QueryResult result = dynamoDB.query(queryRequest);

        for (Map<String, AttributeValue> item : result.getItems()) {
            r = result.toString();

        }
    } catch (AmazonServiceException ase) {
        System.err.println("Failed to find item in " + tableName + " " + ase);
    }
    return r;
}