Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
06-21-2021 05:21 AM
In SDN 5 application I had one @RelationshipEntity declared and everything worked fine:
@RelationshipEntity(type = "CONTAINS")
public class DecisionGroupRelationship {
@Id
@GeneratedValue
private Long graphId;
@StartNode
private Decision decision;
@EndNode
private DecisionGroup group;
Now I added the second following @RelationshipEntity:
@RelationshipEntity(type = "CONTAINS")
public class GroupProfileRelationship {
@Id
@GeneratedValue
private Long graphId;
@StartNode
private ProfileGroup group;
@EndNode
private Profile profile;
and now receiving a lot of ERRORs in the log:
2021-06-21 15:16:35.346 ERROR 24796 --- [ main] org.neo4j.ogm.context.GraphEntityMapper : Found more than one matching @RelationshipEntity for (1565)-[CONTAINS]->(1560) but cannot tell which one to use
but the application still working fine.
What am I doing wrong and how to fix it ?
06-22-2021 12:10 AM
It looks like Neo4j-OGM cannot determine which RelationshipEntity
to apply.
Could you please provide the NodeEntity
in question? Also it would be helpful to know the exact versions of SDN and Neo4j-OGM you are using.
06-22-2021 12:35 PM
Looks like I had an ambiguity in my entity mappings. Previously I had something similar to:
@NodeEntity
public class Decision extends BaseEntity {
private static final String CONTAINS = "CONTAINS";
@Relationship(type = CONTAINS, direction = Relationship.INCOMING)
private Set<DecisionGroup> parentGroups;
@Relationship(type = CONTAINS, direction = Relationship.OUTGOING)
private Set<DecisionGroup> childGroups;
but right now switched to:
@NodeEntity
public class Decision extends BaseEntity {
private static final String CONTAINS = "CONTAINS";
@Relationship(type = CONTAINS, direction = Relationship.INCOMING)
private Set<GroupDecisionRelationship> parentGroupRelationships = new HashSet<>();
@Relationship(type = CONTAINS, direction = Relationship.OUTGOING)
private Set<DecisionGroupRelationship> childGroupRelationships = new HashSet<>();
and the issue is gone
All the sessions of the conference are now available online