Chapter 5. Querying the Data Grid

So far, you have learned how to access data in the Coherence cache using identity-based operations, such as get and put. In many cases this will be exactly what you need, but there will also be many other situations where you either won't know an object's identity or you will simply need to look up one or more objects based on attributes other than the identity.

Coherence allows you to do that by specifying a filter for set-based operations defined by the QueryMap interface, which we mentioned briefly in Chapter 3, Planning Your Caches.

public interface QueryMap extends Map {
  Set keySet(Filter filter);
  Set entrySet(Filter filter);
  Set entrySet(Filter filter, Comparator comparator);
  ...
}

As you can see from the previous ...

Get Oracle Coherence 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.