return input.get("id").toString();
}});
// Confirm get by index_1 query
SortedMap<String, Object> indexValues = Maps.newTreeMap();
indexValues.put("index_1", "index1");
Criteria criteria = new Criteria();
criteria.setIndexKeys(indexValues);
criteria.setLimit(50L);
List<Map<String, Object>> results = om.list(testUniqueTableName, criteria);
Map<String, Map<String, Object>> indexedResults;
indexedResults = Maps.uniqueIndex(results, new Function<Map<String, Object>, String>() {
public String apply(Map<String, Object> input) {
return input.get("id").toString();
}
});
Map<String, Map<String, Object>> indexedExpected1 = Maps.newHashMap(indexedExpected);
// Index_1 test data doesn't include value 4
indexedExpected1.remove("864f1400-2a7e-11b2-8080-808080808080");
assertEquals(indexedExpected1, indexedResults);
// Confirm get by index_2 query
indexValues = Maps.newTreeMap();
indexValues.put("index_2", "index2");
criteria = new Criteria();
criteria.setIndexKeys(indexValues);
criteria.setLimit(50L);
results = om.list(testUniqueTableName, criteria);
indexedResults = Maps.uniqueIndex(results, new Function<Map<String, Object>,String>() {
public String apply(Map<String, Object> input) {
return input.get("id").toString();