Announcement Announcement Module
No announcement yet.
Relationship with multiple End Node types? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Relationship with multiple End Node types?

    Is there any way to have a @RelationshipEntity in spring-data-neo4j that, in it, has more then one @StartNode or @EndNode, or for a type to be used by more then once class?

    I ask because I have some relationships, "Owns", that can go from a "Person" node to several other typed nodes, IE "Pet", "Car", etc.

    I have tried putting multiple @EndNode in a relationship type, but that doesn't work, instead it takes the last declared in a Class and that it the one it created.

    I have also tried creating several Relationship classes, all with the same type, but this leads to weird results when using @RelatedTo with the type. IE If "Person" has a "Pet" and "Car", the Set<Car> cars contains both "Pet" and "Car", even thought "Pet" isn't castable to "Car".

    So, is there any way to have a relationship in spring-data-neo4j have several End or Start Node Class types?