Collapse All Expand All

C#

Oracle® Coherence .NET API Reference
KeyExtractor Class
Members See Also Send Feedback

Oracle® Coherence .NET API Reference Release 3.6
E15727-01
The KeyExtractor is a special purpose IValueExtractor implementation that serves as an indicator that a query should be run against the key objects rather than the values.

Namespace: Tangosol.Util.Extractor
Assembly: Coherence (in Coherence.dll) Version: 3.6.0.0 (3.6.0.0)

# Syntax

C#
    public class KeyExtractor : AbstractExtractor,
    	IPortableObject

# Remarks

The major difference between the KeyExtractor and a standard ReflectionExtractor is that when used in various IFilter implementations it forces the evaluation of entry keys rather than entry values.

For example, consider a key object that consists of two properties: "FirstName" and "LastName". To retrieve all keys that have a value of the "LastName" property equal to "Smith", the following query could be used:

                IValueExtractor extractor = new KeyExtractor("LastName");
                ICollection keys = cache.GetKeys(new EqualsFilter(extractor, "Smith"));

As of Coherence 3.5, the same effect can be achieved for subclasses of the AbstractExtractor, for example:

                IValueExtractor extractor = new ReflectionExtractor("LastName",
                null,AbstractExtractor.KEY);
                ICollection keys = cache.GetKeys(new EqualsFilter(extractor, "Smith"));

# Inheritance Hierarchy

System..::.Object
Tangosol.Util.Extractor..::.AbstractExtractor
Tangosol.Util.Extractor..::.KeyExtractor

# See Also

KeyExtractor Members
Tangosol.Util.Extractor Namespace