You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by "Maxim.Pudov" <pu...@gmail.com> on 2018/09/19 13:06:39 UTC

Affinity key field name and value field name conflict

I've been working on https://issues.apache.org/jira/browse/IGNITE-7793
and found out that we don't have validation for such case:

PersonKey {
    int id;
    String name;
}

Person {
    String name;
}

CacheKeyConfiguration keyCfg =new CacheKeyConfiguration(PersonKey.getName(),
"name");

QueryEntity entity = new QueryEntity();
entity.setKeyType(keyClass.getName());
entity.setValueType(Person.class.getName());
entity.addQueryField("id", Integer.class.getName(), null);
entity.addQueryField("name", String.class.getName(), null);

Query select * from "person".Person t where t.name = ? would silently use
affinity key with no warning, however there is another field "name" in class
Person.
Is this an issue or we can leave it as is?



--
Sent from: http://apache-ignite-developers.2346864.n4.nabble.com/