Create Indexes Using a Coherence Function

This method applies to the Coherence cache provider only. It is not the preferred method. It is recommended that you use the method explained in.

You can create an ordered or unordered index using the following function in a startup rule function.

C_Index(String cacheName, Object property, boolean isOrdered)

where:

cacheName is a String returned by C_CacheName().

property is the object returned by the appropriate C_DatatypeAtomGetter functions, for example, C_StringAtomGetter().

isOrdered is a Boolean: set to true to order the contents of the indexed information, and set to false if you want to use an unordered index.

For example:

String cacheName = Coherence.C_CacheName("/Customer");
Object getter = Coherence.Extractor.C_IntAtomGetter("age");
Coherence.C_Index(cacheName, getter, true);