Announcement Announcement Module
Collapse
No announcement yet.
NeoJ/GraphRepository<T>: wrong cypher query generated when no index on field Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NeoJ/GraphRepository<T>: wrong cypher query generated when no index on field

    On spring-data-neo4j-2.1.0.M1.jar

    Code:
    Iterable<SomeClass> findByIndexedFieldAndNotIndexedField(String inIdxField, Float inNoIdxField) ;
    will generate a Cypher query where the non-indexed field is wrongly referenced:

    Code:
    "start `someClass`=node:`indexName`({0}) where `sameClass`.`itsNoIdxField` AND `someClass`.`itsNoIdxField` = {1} return `someClass`"
    of course we got a BadInputException on the first reference to sameClass.inNoIdxField…

    For now the solution is to use @Query:
    Code:
    @Query("start someClass=node:SomeClass(indexName={name}) where someClass.itsNoIdxField = {version} return someClass")
    (with @Param on the parameters of the "find…" method)

    To be complete:
    the involved class is a subclass of another one (both @NodeEntity) and the indexed field is a field of the subclass while the not indexed one is a member of the superclass.

  • #2
    JeitEmgie,

    There was some work done literally last week on derived queries. I suggest you try upgrading.

    Currently that work is in BUILD_SNAPSHOTs, and will be in SDN RC4 coming out this week.

    Regards,

    Lasse

    Comment

    Working...
    X