ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tusharnakra <tusharna...@hotmail.com>
Subject Re: How to load 2 tables in a cache
Date Wed, 13 Apr 2016 16:03:10 GMT
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&lt;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&lt;?>> cursor = cache.query(new
SqlFieldsQuery(sql));

        // In this particular case each row will have one element with full
name of an employees.
        List<List&lt;?>> 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.

Mime
View raw message