Search code examples
neo4jspring-data-neo4jneo4j-apoc

@RelationshipEntity doesn't map after executing a Neo4j Query in spring boot


`I tried to relationship property in a spring boot application. Nodes created, but the relationship is not connected between the nodes.Code belows

@Node 
public class Person {
@Id
private String PersonId;
@Relationship(type = "has_primaryskill", direction = Direction.OUTGOING)
private LangProperties planguage;}
@RelationshipProperties
public class LangProperties {
@TargetNode
private Language language;
@Id
@GeneratedValue
Long id;
@Property
private String values;
}
@Node(value = "Language")
public class Language {
@Id
private String tech;}

Problem: person and language nodes are created but relationship is not created.Please help on this issue

Spring boot version as 2.6 and maven neo4j version as 4.0.0

Tried with above code.Its not establish the relationship with property beteween the nodes`


Solution

  • Problem is in dependency.Need to use the maven dependency for neo4j spring data to resolve the problem

    > <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-neo4j</artifactId>
    </dependency>
    

    Don't use any other neo4j dependency. `