You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Ksenia Rybakova (JIRA)" <ji...@apache.org> on 2016/12/19 13:46:58 UTC

[jira] [Created] (IGNITE-4456) ODBC DML: add to doc some info on how to deal with complex affinity key and partitioned cache

Ksenia Rybakova created IGNITE-4456:
---------------------------------------

             Summary: 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");
...
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)