[ https://issues.apache.org/jira/browse/IGNITE-13028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17214411#comment-17214411 ]
Ilya Kazakov commented on IGNITE-13028: --------------------------------------- [~ilyak], please review again. > Spring Data integration doesn't introspect the fields of the key object > ----------------------------------------------------------------------- > > Key: IGNITE-13028 > URL: https://issues.apache.org/jira/browse/IGNITE-13028 > Project: Ignite > Issue Type: Improvement > Components: spring, springdata > Affects Versions: 2.8 > Reporter: Denis A. Magda > Assignee: Ilya Kazakov > Priority: Major > Labels: newbie > Fix For: 2.10 > > Time Spent: 20m > Remaining Estimate: 0h > > Suppose you have key and value POJOs associated with Ignite caches/tables: > * Key: > https://github.com/GridGain-Demos/ignite-spring-data-demo/blob/master/src/main/java/org/gridgain/demo/springdata/model/CityKey.java > * Value: > https://github.com/GridGain-Demos/ignite-spring-data-demo/blob/master/src/main/java/org/gridgain/demo/springdata/model/City.java > The key object includes a couple of fields ({{id}} and {{countryCode}}) that > are not visible to the Spring's query-autogeneration feature. For instance, > you have to use direct queries if want to get [all the cities with a specific > value of {{id}} > field|https://github.com/GridGain-Demos/ignite-spring-data-demo/blob/master/src/main/java/org/gridgain/demo/springdata/dao/CityRepository.java#L42]: > {code:java} > @Query("SELECT * FROM City WHERE id = ?") > public Cache.Entry<CityKey, City> findById(int id); > {code} > If the query-autogeneration feature could introspect the metadata of the key, > then you would not need to fall back to the direct queries and would add the > following query to the repository: > {code:java} > public Cache.Entry<CityKey, City> findById(int id); > {code} > The same issue exists if a key is of a primitive type (Integer, String, etc.) > To reproduce you can use this project: > https://github.com/GridGain-Demos/ignite-spring-data-demo -- This message was sent by Atlassian Jira (v8.3.4#803005)