You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Edward Chen <ja...@gmail.com> on 2020/02/13 19:32:00 UTC

Load cache data into another POJO with SQL

Hello,

I am using Ignite SQL, wondering it is possible to load cache data into 
another POJO ?  just like ORM, sql like this :

select new MyPojo(p.name, p.age) from myCacheTable as p where p.age > 30

Thanks. Ed




Re: Load cache data into another POJO with SQL

Posted by Evgenii Zhuravlev <e....@gmail.com>.
Hi,

You can implement your own CacheStore and transform data in it:
https://apacheignite.readme.io/docs/3rd-party-store#section-custom-cachestore

Best Regards,
Evgenii

чт, 13 февр. 2020 г. в 13:29, Denis Magda <dm...@apache.org>:

> I doubt that this is supported.
>
> -
> Denis
>
>
> On Thu, Feb 13, 2020 at 11:32 AM Edward Chen <ja...@gmail.com> wrote:
>
>> Hello,
>>
>> I am using Ignite SQL, wondering it is possible to load cache data into
>> another POJO ?  just like ORM, sql like this :
>>
>> select new MyPojo(p.name, p.age) from myCacheTable as p where p.age > 30
>>
>> Thanks. Ed
>>
>>
>>
>>

Re: Load cache data into another POJO with SQL

Posted by Denis Magda <dm...@apache.org>.
I doubt that this is supported.

-
Denis


On Thu, Feb 13, 2020 at 11:32 AM Edward Chen <ja...@gmail.com> wrote:

> Hello,
>
> I am using Ignite SQL, wondering it is possible to load cache data into
> another POJO ?  just like ORM, sql like this :
>
> select new MyPojo(p.name, p.age) from myCacheTable as p where p.age > 30
>
> Thanks. Ed
>
>
>
>

Re: Load cache data into another POJO with SQL

Posted by Ilya Kasnacheev <il...@gmail.com>.
Hello!

I'm not sure the rest of Ignite community will approve, but you can
actually try to write an SQL extension function, which will serve as
factory method for MyPojo.

https://apacheignite-sql.readme.io/docs/custom-sql-functions

This is used in conjunction with Geometry with some success. It will only
use with SqlFielsQuery but not with JDBC or other "thin" API.

Please note that you will have to register this function with some schema
in some cache confguration.

Regards,
-- 
Ilya Kasnacheev


чт, 13 февр. 2020 г. в 22:32, Edward Chen <ja...@gmail.com>:

> Hello,
>
> I am using Ignite SQL, wondering it is possible to load cache data into
> another POJO ?  just like ORM, sql like this :
>
> select new MyPojo(p.name, p.age) from myCacheTable as p where p.age > 30
>
> Thanks. Ed
>
>
>
>