Hi,
Yes, you understand correctly. Here is example:
private static void sqlQuery() {
IgniteCache<AffinityKey<Long>, Person> cache =
Ignition.ignite().cache(PERSON_CACHE);
// SQL clause which selects salaries based on range.
String sql = "salary > ? and salary <= ?";
// People with salaries between 1000 and 2000.
try (QueryCursor<Cache.Entry<AffinityKey<Long>, Person>>
cursor =
cache.query(new SqlQuery<AffinityKey<Long>,
Person>(Person.class, sql).
setArgs(1000, 2000))) {
// Cursor is Iterable, so you may iterate over it with for each
loop.
for (Cache.Entry<AffinityKey<Long>, Person> entry : cursor)
System.out.println("Key: " + entry.getKey() + ", Value: " +
entry.getValue());
}
}
It's based on
https://github.com/apache/ignite/blob/master/examples/src/main/java/org/apache/ignite/examples/datagrid/CacheQueryExample.java
-Dmitry.
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/ScanQuery-log-all-entries-tp11970p12017.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.