[
https://issues.apache.org/jira/browse/IGNITE-4456?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ksenia Rybakova updated IGNITE-4456:
------------------------------------
Description:
Example:
{code}
CacheConfiguration<AffinityKey<Long>, Person> personCacheCfg = new
CacheConfiguration<>("Persons");
personCacheCfg.setCacheMode(CacheMode.PARTITIONED);
...
public AffinityKey<Long> key() {
if (key == null)
key = new AffinityKey<>(id, orgId);
return key;
}
{code}
Currently it's not obvious that in such a case we should:
1) Use QueryEntity to specify {{key}} and {{affKey}} as key fields as it's
described in https://apacheignite.readme.io/docs/dml#section-custom-keys
2) Use {{key}} and {{affKey}} in statements directly instead of {{_key}}:
{code}
"INSERT INTO Person(key, affKey, firstName, lastName, resume, salary, orgId)
VALUES (42, 2, 'Ivan', 'Ivanov', 'Ivan Ivanov has no
degree', CAST(300 AS DOUBLE), 2)"
{code}
was:
Example:
{code}
CacheConfiguration<AffinityKey<Long>, Person> personCacheCfg = new
CacheConfiguration<>("Persons");
...
public AffinityKey<Long> key() {
if (key == null)
key = new AffinityKey<>(id, orgId);
return key;
}
{code}
Currently it's not obvious that in such a case we should:
1) Use QueryEntity to specify {{key}} and {{affKey}} as key fields as it's
described in https://apacheignite.readme.io/docs/dml#section-custom-keys
2) Use {{key}} and {{affKey}} in statements directly instead of {{_key}}:
{code}
"INSERT INTO Person(key, affKey, firstName, lastName, resume, salary, orgId)
VALUES (42, 2, 'Ivan', 'Ivanov', 'Ivan Ivanov has no
degree', CAST(300 AS DOUBLE), 2)"
{code}
> ODBC DML: add to doc some info on how to deal with complex affinity key and
> partitioned cache
> ---------------------------------------------------------------------------------------------
>
> Key: IGNITE-4456
> URL: https://issues.apache.org/jira/browse/IGNITE-4456
> Project: Ignite
> Issue Type: Improvement
> Affects Versions: 1.8
> Reporter: Ksenia Rybakova
>
> Example:
> {code}
> CacheConfiguration<AffinityKey<Long>, Person> personCacheCfg = new
> CacheConfiguration<>("Persons");
> personCacheCfg.setCacheMode(CacheMode.PARTITIONED);
> ...
> public AffinityKey<Long> key() {
> if (key == null)
> key = new AffinityKey<>(id, orgId);
> return key;
> }
> {code}
> Currently it's not obvious that in such a case we should:
> 1) Use QueryEntity to specify {{key}} and {{affKey}} as key fields as it's
> described in https://apacheignite.readme.io/docs/dml#section-custom-keys
> 2) Use {{key}} and {{affKey}} in statements directly instead of {{_key}}:
> {code}
> "INSERT INTO Person(key, affKey, firstName, lastName, resume, salary, orgId)
> VALUES (42, 2, 'Ivan', 'Ivanov', 'Ivan Ivanov has no
> degree', CAST(300 AS DOUBLE), 2)"
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)