ignite-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergi Vladykin <sergi.vlady...@gmail.com>
Subject Re: @SqlQueryField on composite primary key
Date Thu, 16 Feb 2017 11:15:22 GMT
If you are going to store this stuff in cache like

cache.put(myPersonPK, myPerson)

then storing PersonPK inside of Person is bad idea, because PK will be
stored twice in cache.

I'm not sure I understand your question, but it seems to me that you don't
need to do anything here because cache key is always accessible from SQL as
_KEY field.

Sergi

2017-02-16 13:48 GMT+03:00 zaid <zaid.saeedi.khan@gmail.com>:

> Hi,
>
> My POJO has composite primary key.
>
> e.g.
>
> public class Person {
>
> PersonPK id;
>
> String name;
>
> }
>
> public class PersonPK {
> Long id1;
> String personType;
> }
>
> These classes are just for example purpose. My question is - can I apply
> @SqlQueryField directly on id field in Person class which is of type
> PersonPK. How this will be used while creating table in H2?
>
>
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/SqlQueryField-on-composite-primary-key-tp10666.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>

Mime
View raw message