Search in sources :

Example 1 with DynamoDBResult

use of org.apache.gora.dynamodb.query.DynamoDBResult in project gora by apache.

the class DynamoDBNativeStore method execute.

/**
   * Executes a query after building a DynamoDB specific query based on the
   * received one
   */
@Override
public Result<K, T> execute(Query<K, T> query) {
    DynamoDBQuery<K, T> dynamoDBQuery = buildDynamoDBQuery(query);
    DynamoDBMapper mapper = new DynamoDBMapper(dynamoDBStoreHandler.getDynamoDbClient());
    List<T> objList = null;
    if (DynamoDBQuery.getType().equals(DynamoDBQuery.RANGE_QUERY))
        objList = mapper.scan(persistentClass, (DynamoDBScanExpression) dynamoDBQuery.getQueryExpression());
    if (DynamoDBQuery.getType().equals(DynamoDBQuery.SCAN_QUERY))
        objList = mapper.scan(persistentClass, (DynamoDBScanExpression) dynamoDBQuery.getQueryExpression());
    return new DynamoDBResult<K, T>(this, query, objList);
}
Also used : DynamoDBResult(org.apache.gora.dynamodb.query.DynamoDBResult) DynamoDBMapper(com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper)

Aggregations

DynamoDBMapper (com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper)1 DynamoDBResult (org.apache.gora.dynamodb.query.DynamoDBResult)1