I tried to relationship property in a spring boot application. Nodes created, but the relationship is not connected between the nodes.Code belows
@Node(value = "Person")
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
This should work fine. And place, if you don't need it, don't create bidirectional relationships (as advised).
Could you please show the exact code of the entities? Are you using Lombok and/or have custom equals/hashCode?
Also the calling code that creates the two nodes with the relationship might be helpful.
I faced the same issue once. You should also have an Incoming relationship in Language as well but I am not so sure about it. Try it and leave a feedback. And also like @glilienfield mentioned, remove @Id and @GeneratedValue and replace them with @RelationshipId and put it before private Language language.
I actually use neo4j and neo4j maven dependence spring data. Because of the two dependencies facing the above problem. After removing neo4j dependency its working fine