Permalink
Browse files

fixed node reflection for existing relationships on merge

  • Loading branch information...
1 parent d20bd6f commit b8d700a4d520dfb7c3f733b1dde97f1018ddd7c1 @nigelsmall nigelsmall committed Mar 3, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 geoff-core/src/main/java/org/neo4j/geoff/Neo4jGraphProxy.java
@@ -394,14 +394,21 @@ private void mergeRelationships(NodeToken a, RelationshipToken r, NodeToken b, M
int index = r.getIndex();
int currentIndex = 0;
boolean found = false;
+ HashSet<Node> startNodes = new HashSet<Node>();
+ HashSet<Node> endNodes = new HashSet<Node>();
for (Relationship relationship : relationships) {
currentIndex++;
if (index == 0 || index == currentIndex) {
found = true;
+ startNodes.add(relationship.getStartNode());
+ endNodes.add(relationship.getEndNode());
setProperties(relationship, properties);
}
}
- if (!found) {
+ if (found) {
+ this.nodeStore.put(a, startNodes);
+ this.nodeStore.put(b, endNodes);
+ } else {
relationships.addAll(createRelationships(a, r, b, properties, bothWays));
}
relationshipStore.put(r, relationships);

0 comments on commit b8d700a

Please sign in to comment.