Uploaded image for project: 'Hibernate OGM'
  1. OGM-1290

'target' node in Neo4j association queries needs to be qualified with a label

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.Final
    • Fix Version/s: 5.2.0.Alpha1
    • Component/s: neo4j
    • Labels:
      None

      Description

      The query for @OneToMany is insufficient when there are multiple of them in a class, each mapped by an identically-named field in the associated class. We have an entity class with two 'children' collections, and each 'child' entity references the parent with the field named 'parent'.

      It generates the following for each children collection, which picks up both kinds of children in a single query:

      MATCH (owner:ENTITY:PARENT_CLASS`

      {dbId: 54}

      ) [r:parent] (target) RETURN id(target), r, owner, target ORDER BY id(target);

      The query should probably be:

      MATCH (owner:ENTITY:PARENT_CLASS`

      {dbId: 54}

      ) [r:parent] (target:CHILD_CLASS) RETURN id(target), r, owner, target ORDER BY id(target);

      The workaround is to change the 'parent' field name in one of them.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: