Hello Folks,

Just to add a little bit more clarity & context...taking the Cross-Cache
querying example from the ignite docs (copied below) if one were to select
fields from both Person & Organization table caches in the select query
what would be the elegant way to construct a domain POJO from the query
result set instead of constructing it in the application code.


   - Cross-Cache SqlFieldsQuery
   <https://apacheignite.readme.io/docs/sql-queries>

// In this example, suppose Person objects are stored in a // cache
named 'personCache' and Organization objects // are stored in a cache
named 'orgCache'.IgniteCache<Long, Person> personCache =
ignite.cache("personCache");
// Select with join between Person and Organization to // get the
names of all the employees of a specific organization.SqlFieldsQuery
sql = new SqlFieldsQuery(
    "select Person.name  "
        + "from Person as p, \"orgCache\".Organization as org where "
        + "p.orgId = org.id "
        + "and org.name = ?");
// Execute the query and obtain the query result cursor.try
(QueryCursor<List<?>> cursor =
personCache.query(sql.setArgs("Ignite"))) {
    for (List<?> row : cursor)
        System.out.println("Person name=" + row.get(0));
}


Regards,
Muthu

-- The latest fact in modern technology isn't that machines will begin to
think like people, but that people will begin to think like machines.
-- Nothing exists except atoms and empty space, everything else is opinion
- *Democritus*

On Tue, May 30, 2017 at 4:26 PM, Muthu <[email protected]> wrote:

>
> Just to clarify a little bit i don't want the view created on the database
> but rather created & exposed purely in ignite. The individual tables are
> already cached & available as L2 cache (MyBatis L2 cache) in Ignite.
>
> Regards,
> Muthu
>
>
> On Tue, May 30, 2017 at 4:07 PM, Muthu <[email protected]> wrote:
>
>> Hi Folks,
>>
>> I need to combine two table caches to expose a database view type cache.
>> Is there an elegant way to do this where i don't need to manually
>> set/construct the view's POJO from the result of the join query?
>>
>> Regards,
>> Muthu
>>
>>
>

Reply via email to