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);
}
Aggregations