String tableName = getTable(collection);
List<T> result = new ArrayList<T>();
if (indexedProperty != null && (!INDEXEDPROPERTIES.contains(indexedProperty))) {
String message = "indexed property " + indexedProperty + " not supported, query was '>= '" + startValue + "'; supported properties are "+ INDEXEDPROPERTIES;
LOG.info(message);
throw new DocumentStoreException(message);
}
try {
connection = getConnection();
long now = System.currentTimeMillis();
List<RDBRow> dbresult = dbQuery(connection, tableName, fromKey, toKey, indexedProperty, startValue, limit);
for (RDBRow r : dbresult) {
T doc = runThroughCache(collection, r, now);
result.add(doc);
}
} catch (Exception ex) {
LOG.error("SQL exception on query", ex);
throw new DocumentStoreException(ex);
} finally {
closeConnection(connection);
}
return result;
}