Uploaded image for project: 'Spring Data Neo4j'
  1. Spring Data Neo4j
  2. DATAGRAPH-211

Bad id returned when querying with Gremlin

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 2.1.M1
    • None
    • CORE
    • In pom.xml:
       - SDN 2.1.0.M1
       - Gremlin 1.4
       - Neo4j 1.6.1

    Description

      Set up a repository and a Gremlin query:
      public interface ProjectRepository extends GraphRepository<Project> {
      @Query(value="g.v(project).pid", type=QueryType.Gremlin)
      String findProjectId(@Param("project") Project project);
      }

      The corresponding NodeEntity:
      @NodeEntity
      public class Project {
      @GraphId Long internalId;
      @Indexed(unique=true) String pid;
      public Project(String pid)

      { this.pid = pid; }

      }

      "projectRepo.findProjectId(new Project("p019"));" returns "p019"
      A "g.v(project).keys()" statements returns : [pid, __type__]
      That's the normal case.

      Now change the NodeEntity to:
      @NodeEntity
      public class Project {
      @GraphId Long internalId;
      @Indexed(unique=true) String id;
      public Project(String id)

      { this.id = id; }

      }
      And the Gremlin query to: g.v(project).id

      "projectRepo.findProjectId(new Project("p019"));" returns 29 (the internal GraphId, not the one you set). It should still return "p029".
      A "g.v(project).keys()" statements returns : [id, __type__]

      Attachments

        Activity

          People

            mhunger Michael Hunger
            mdeverdelhan Marc de Verdelhan
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: