Announcement Announcement Module
No announcement yet.
Neo4j - graphRepository Method with Multiple Key Lookups Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Neo4j - graphRepository Method with Multiple Key Lookups

    I have some items in my Graph that are uniquely identified by a composite key, {ParentId, Country, ChildKey}. I would like to create a GraphRepository method that would allow me to access this Node using these three keys, however when I try to create a method that try to do this multi-key lookup I get nothing back. My method name is as follows:

    findChildByParentIdAndCountryAndChildKey(Long parentId, String country, Long childKey);
    Each of the parameters on the method signature are properties of my Child node, and all 3 are indexed(though not uniquely since neo4j/spring-data does fully support composite keys).

    Can this be done in the current version of spring-data-neo4j(2.1.0-RELEASE)?

    //EDIT: This actually is an issue with a numeric field and composite keys. The childKey and parentId fields are Longs, and by default indexed numeric. If I do a lookup by the field alone, it returns, but if I do a composite key lookup it fails on the numeric. When I change these @Indexed Annotations to include numeric=false the composite key lookup fails.
    Last edited by nicholasastuart; Jan 25th, 2013, 04:33 PM.