Thanks Nikolai for the suggestion..one other thing i was thinking was to use continuous queries feature to create & update the new cache...but the problem is i still have to manually construct the resultant DTO object (manually set every field in the code). Since this is a view that joins two or three tables with lots of columns i was wondering if there was a way i can auto generate this boiler plate code...
Regards, Muthu On Mon, Jun 5, 2017 at 5:44 AM, Nikolai Tikhonov <[email protected]> wrote: > Hello, > > You need to implement your own CacheStore which will execute several > selects for one entry and combine two rows to one cache entry. > > On Thu, Jun 1, 2017 at 9:34 AM, Muthu <[email protected]> wrote: > >> 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 >>>> >>>> >>> >> >
