March 2010
Intermediate to advanced
408 pages
9h 59m
English
The easiest way to obtain query results is to invoke one of the QueryMap.entrySet methods:
Filter filter = ...; Set<Map.Entry> results = cache.entrySet(filter);
This will return a set of Map.Entry instances representing both the key and the value of a cache entry, which is likely not what you want. More often than not you need only values, so you will need to iterate over the results and extract the value from each Map.Entry instance:
List values = new ArrayList(results.size());
for (Map.Entry entry : entries) {
values.add(entry.getValue());
}After doing this a couple times you will probably want to create a utility method for this task. Because all the queries should be encapsulated within various repository implementations, ...
Read now
Unlock full access