OK, UPDATE:
This method is working, but how do I add setArgs (I mean, I want to pass the
argument for orgname as "Ignite" i.e. to only print person names in Ignite
organization. How to do that??? It's giving error if I simply do as given on
the ignite website:
private static void sqlFieldsQueryWithJoin() {
IgniteCache<AffinityKey<Long>, Person> cache =
Ignition.ignite().cache("PCache");
//String oname = "Barclays";
// Execute query to get names of all employees.
String sql =
"select concat(firstName, ' ', lastName), org.orgname " +
"from Person, \"" + ORG_CACHE + "\".Organization as org " +
"where Person.orgid = org.orgid";
QueryCursor<List<?>> cursor = cache.query(new
SqlFieldsQuery(sql));
// In this particular case each row will have one element with full
name of an employees.
List<List<?>> res = cursor.getAll();
// Print persons' names and organizations' names.
print("Names of all employees and organizations they belong to:",
res);
}
--
View this message in context:
http://apache-ignite-users.70518.x6.nabble.com/How-to-load-2-tables-in-a-cache-tp4026p4136.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.