You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While dealing with entity relationships, currently the only way of creating multiple relationships of the same type between two nodes is by using neo4j-template. It would be interesting to have it available from a RelationshipOperationsRepository.
Don't know if it would make sense to allow it also from the annotated entity with some kind of @RelatedToVia(multiple=true) so as there would be no need to use the repository directly.
IMHO, i wouln't include the same option for @RelatedTo, as there would be no "useful" information on having multiple relationships of the same type between two nodes, that would be equivalent to having a single relationship with a "counter" property, which has more sense, right?
One note: when creating duplicate relationships externally, it's not possible to update node properties without "destroying" duplicates. I guess this is because the duplication control filters all those created externally
There is no notion of externally or internally created relationships.
The constraint on unique relationships is needed to allow automatic delta detection of changes in related-node-collections. If duplicates are allowed you cannot decide anymore which rels have to be added and deleted as you miss the necessary information in a set of node-entities (there is no deeper, distinguishing semantic to those relationships).
It is correct that this could and should be possible with relationship entities. Having the attribute on the annotation makes sense and was already discussed some time ago. http://forum.springsource.org/showthread.php?114614
Juan Pablo opened DATAGRAPH-152 and commented
While dealing with entity relationships, currently the only way of creating multiple relationships of the same type between two nodes is by using neo4j-template. It would be interesting to have it available from a RelationshipOperationsRepository.
Don't know if it would make sense to allow it also from the annotated entity with some kind of
@RelatedToVia
(multiple=true) so as there would be no need to use the repository directly.IMHO, i wouln't include the same option for
@RelatedTo
, as there would be no "useful" information on having multiple relationships of the same type between two nodes, that would be equivalent to having a single relationship with a "counter" property, which has more sense, right?Affects: 2.0.RC1
Reference URL: http://forum.springsource.org/showthread.php?114614-Spring-Data-Graph-Why-only-one-relationship-of-a-type-between-two-nodes&p=393512#post393512
The text was updated successfully, but these errors were encountered: