You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by kotamrajuyashasvi <ko...@gmail.com> on 2017/07/27 11:53:08 UTC

using user defined object as key in ignite c++ client

Hi.. I was able to run a sample c++ client program , loading/retrieving cache
from a table in  persistent store. The table has just one int field as
primary key and for cache I configured this primary key int as the cache
key. But now I want to use cache for table in persistent store which have
combination of different fields as primary key. What should I use as a cache
key in this situation? Just like I used POJO to map cache values, should I
use another POJO for cache keys?If so how should I map cache key POJO to
c++?



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/using-user-defined-object-as-key-in-ignite-c-client-tp15727.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: using user defined object as key in ignite c++ client

Posted by kotamrajuyashasvi <ko...@gmail.com>.
Thanks for the response. I am able to use object as key now



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/using-user-defined-object-as-key-in-ignite-c-client-tp15727p15859.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

Re: using user defined object as key in ignite c++ client

Posted by Igor Sapego <is...@gridgain.com>.
Hi,

You need to declare matching class in C++ and specialize
BinaryType template for it as described at [1].

You can find which type in C++ matches which type from
Java at [2].

[1] - https://apacheignite-cpp.readme.io/docs/serialization
[2] -
https://apacheignite-cpp.readme.io/docs/cross-platform-interoperability#section-basic-types-compatibility

Best Regards,
Igor

On Thu, Jul 27, 2017 at 2:53 PM, kotamrajuyashasvi <
kotamrajuyashasvi@gmail.com> wrote:

> Hi.. I was able to run a sample c++ client program , loading/retrieving
> cache
> from a table in  persistent store. The table has just one int field as
> primary key and for cache I configured this primary key int as the cache
> key. But now I want to use cache for table in persistent store which have
> combination of different fields as primary key. What should I use as a
> cache
> key in this situation? Just like I used POJO to map cache values, should I
> use another POJO for cache keys?If so how should I map cache key POJO to
> c++?
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/using-user-defined-object-as-key-in-
> ignite-c-client-tp15727.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>