Affinity key field name and value field name conflict

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Affinity key field name and value field name conflict

Maxim.Pudov
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/