use of org.apache.gora.rethinkdb.query.RethinkDBResult in project gora by apache.
the class RethinkDBStore method execute.
/**
* {@inheritDoc}
*/
@Override
public Result<K, T> execute(Query<K, T> query) throws GoraException {
String[] fields = getFieldsToQuery(query.getFields());
RethinkDBQuery dataStoreQuery;
if (query instanceof RethinkDBQuery) {
dataStoreQuery = ((RethinkDBQuery) query);
} else {
dataStoreQuery = (RethinkDBQuery) ((PartitionQueryImpl<K, T>) query).getBaseQuery();
}
dataStoreQuery.populateRethinkDBQuery(rethinkDBMapping, rethinkDBStoreParameters, fields, getFields());
try {
ReqlExpr reqlExpr = dataStoreQuery.getRethinkDBDbQuery();
com.rethinkdb.net.Result<MapObject> result = reqlExpr.run(connection, MapObject.class);
return new RethinkDBResult<>(this, query, result);
} catch (Exception e) {
throw new GoraException(e);
}
}
Aggregations