I have created two different Spring Data Neo4j 5 @RelationshipEntity with the same type:
@RelationshipEntity(type = "CONTAINS")
public class CharacteristicRelationship {
    @Id
    @GeneratedValue
    private Long id;
    @StartNode
    private CharacteristicGroup characteristicGroup;
    @EndNode
    private Characteristic characteristic;
}
@RelationshipEntity(type = "CONTAINS")
public class DecisionGroupRelationship {
    @Id
    @GeneratedValue
    private Long id;
    @StartNode
    private Decision decision;
    @EndNode
    private DecisionGroup childGroup;
}
everything is working fine and I'm successfully able to pass all my tests but right now I continuously getting the following errors in the console:
2018-04-29 15:36:52.387 ERROR 7664 --- [           main] org.neo4j.ogm.context.GraphEntityMapper  : Found more than one matching @RelationshipEntity for (14762)-[CONTAINS]->(14781) but cannot tell which one to use
2018-04-29 15:36:52.390 ERROR 7664 --- [           main] org.neo4j.ogm.context.GraphEntityMapper  : Found more than one matching @RelationshipEntity for (14762)-[CONTAINS]->(14779) but cannot tell which one to use
2018-04-29 15:36:52.391 ERROR 7664 --- [           main] org.neo4j.ogm.context.GraphEntityMapper  : Found more than one matching @RelationshipEntity for (14762)-[CONTAINS]->(14774) but cannot tell which one to use
What am I doing wrong and how to fix it ? Does it allowed to have different @RelationshipEntity with the same types ?
at org.neo4j.ogm.context.GraphEntityMapper.getRelationshipEntity(Edge) I can see the following code:
} else {
    // almost definitely a user bug
    logger.error("Found more than one matching @RelationshipEntity for {} but cannot tell which one to use",
    edge.toString());
 }
that just prints the error log and that's it. It is really hard to understand from this - it is a bug or no and how to deal with it.
The classes:
@NodeEntity
public class CharacteristicGroup extends BaseEntity {
    private static final String DEFINED_BY = "DEFINED_BY";
    private static final String CONTAINS = "CONTAINS";
    @Index(unique = true)
    private Long id;
    @Index(unique = false)
    private String name;
    @Index(unique = false)
    private String lowerName;
    @Relationship(type = DEFINED_BY, direction = Relationship.OUTGOING)
    private Set<DecisionGroup> decisionGroups;
    @Relationship(type = CONTAINS, direction = Relationship.OUTGOING)
    private Set<CharacteristicRelationship> characteristicRelationships;
...
}
@NodeEntity
public class Characteristic extends BaseEntity {
    private static final String CONTAINS = "CONTAINS";
    @Index(unique = true)
    private Long id;
    @Index(unique = false)
    private String name;
    @Index(unique = false)
    private String lowerName;
    @Relationship(type = CONTAINS, direction = Relationship.OUTGOING)
    private Set<CharacteristicProperty> properties;
    @Relationship(type = CONTAINS, direction = Relationship.INCOMING)
    private Set<CharacteristicRelationship> characteristicRelationships;
...
}
@NodeEntity
public class DecisionGroup extends BaseEntity {
    private static final String CONTAINS_DECISION_GROUP = "CONTAINS_DECISION_GROUP";
    @Index(unique = true)
    private Long id;
    @Index(unique = false)
    private String name;
    @Index(unique = false)
    private String lowerName;
    @Relationship(type = CONTAINS_DECISION_GROUP, direction = Relationship.INCOMING)
    private Set<DecisionGroupRelationship> decisionGroupRelationships;
    @Index(unique = false)
    private int totalChildDecisions;
...
}
@NodeEntity
public class Decision extends BaseEntity {
    private static final String DEFINED_BY = "DEFINED_BY";
    private static final String CONTAINS = "CONTAINS";
    private static final String CONTAINS_DECISION_GROUP = "CONTAINS_DECISION_GROUP";
    public static final String FOLLOWS = "FOLLOWS";
    @Index(unique = true)
    private Long id;
    @Index(unique = false)
    private String name;
    @Index(unique = false)
    private String lowerName;
    @Relationship(type = CONTAINS, direction = Relationship.INCOMING)
    private Set<DecisionGroup> parentGroups;
    @Relationship(type = CONTAINS_DECISION_GROUP, direction = Relationship.OUTGOING)
    private Set<DecisionGroupRelationship> childGroupRelationships;
    @Relationship(type = DEFINED_BY, direction = Relationship.INCOMING)
    private Set<Media> medias;
    @Index(unique = false)
    private int totalViews;
...
}
@NodeEntity
public abstract class BaseEntity implements BaseEntityVisitable {
    private static final String CREATED_BY = "CREATED_BY";
    private static final String UPDATED_BY = "UPDATED_BY";
    private static final String OWNED_BY = "OWNED_BY";
    private static final String CONTAINS = "CONTAINS";
    @Id
    @GeneratedValue
    private Long graphId;
    @Index(unique = true)
    private String uuid;
    @Index(unique = true)
    private String customId;
    @DateLong
    @Index(unique = false)
    private Date createDate;
    @Relationship(type = CREATED_BY, direction = Relationship.OUTGOING)
    private User createUser;
    @DateLong
    @Index(unique = false)
    private Date updateDate;
    @Relationship(type = UPDATED_BY, direction = Relationship.OUTGOING)
    private User updateUser;
    @Relationship(type = OWNED_BY, direction = Relationship.OUTGOING)
    private Set<BaseEntity> ownerEntities;
    @Relationship(type = CONTAINS, direction = Relationship.OUTGOING)
    private Set<Translation> translations;
...
}