GemFire 6.6.3

com.gemstone.gemfire.cache.query
Interface CqResults<E>

All Superinterfaces:
Collection<E>, Iterable<E>, SelectResults<E>

public interface CqResults<E>
extends SelectResults<E>

Represents the results of a CQ query that is executed using CqQuery.executeWithInitialResults() The result will contain the instances of Struct having key and value of the region entry that satisfy the CQ query condition.

 ClientCache cache = ...
 QueryService queryService = PoolManager.find("client").getQueryService();
 CqAttributesFactory cqAf = new CqAttributesFactory();
 CqAttributes cqa = cqAf.create();
 
 String cqQueryStr = "SELECT * FROM /root/employees " +
   "WHERE salary > 50000";
   
 CqQuery cq = queryService.newCq("MyCq", cqQueryStr, cqa); 
 CqResults results = cq.executeWithInitialResults();     
 
 for (Object o : results.asList()) {
   Struct s = (Struct)o;
   System.out.println("key : " + s.get("key") + " value : " + s.get("value"));
 }

 

Since:
6.5
See Also:
Query.execute(), CqQuery.executeWithInitialResults()

Method Summary
 
Methods inherited from interface com.gemstone.gemfire.cache.query.SelectResults
asList, asSet, getCollectionType, isModifiable, occurrences, setElementType
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 


GemFire 6.6.3

Copyright © 1997-2012 VMware, Inc. All rights reserved.