Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

refactored createRelationships

  • Loading branch information...
commit 9d00a44053db3d40383b7ed35a1d97708f7c69aa 1 parent 6fbed1b
Nigel Small authored
Showing with 10 additions and 12 deletions.
  1. +10 −12 geoff-core/src/main/java/org/neo4j/geoff/Neo4jNamespace.java
View
22 geoff-core/src/main/java/org/neo4j/geoff/Neo4jNamespace.java
@@ -201,19 +201,17 @@ public void apply(Iterable<Rule> rules) throws RuleApplicationException {
)
throws RuleApplicationException
{
- if (r.hasType()) {
- Relationship relationship;
- Node startNode = createOrUpdateNodes(a, null).get(0);
- Node endNode = createOrUpdateNodes(b, null).get(0);
- relationship = startNode.createRelationshipTo(endNode, DynamicRelationshipType.withName(r.getType()));
- setProperties(relationship, properties);
- relationshipStore.put(r, relationship);
- ArrayList<Relationship> relationships = new ArrayList<Relationship>();
- relationships.add(relationship);
- return relationships;
- } else {
- throw new RuleApplicationException(this.ruleNumber, "Cannot create untyped relationship");
+ if (!r.hasType()) {
+ throw new RuleApplicationException(this.ruleNumber, "Cannot create untyped relationships");
}
+ Node startNode = createOrUpdateNodes(a, null).get(0);
+ Node endNode = createOrUpdateNodes(b, null).get(0);
+ Relationship relationship = startNode.createRelationshipTo(endNode, DynamicRelationshipType.withName(r.getType()));
+ setProperties(relationship, properties);
+ relationshipStore.put(r, relationship);
+ ArrayList<Relationship> relationships = new ArrayList<Relationship>();
+ relationships.add(relationship);
+ return relationships;
}
private List<Relationship> updateRelationships(
Please sign in to comment.
Something went wrong with that request. Please try again.