use of org.neo4j.server.rest.domain.EndNodeNotFoundException in project neo4j by neo4j.
the class DatabaseActions method createRelationship.
public RelationshipRepresentation createRelationship(long startNodeId, long endNodeId, String type, Map<String, Object> properties) throws StartNodeNotFoundException, EndNodeNotFoundException, PropertyValueException {
Node start, end;
try {
start = node(startNodeId);
} catch (NodeNotFoundException e) {
throw new StartNodeNotFoundException(e);
}
try {
end = node(endNodeId);
} catch (NodeNotFoundException e) {
throw new EndNodeNotFoundException(e);
}
Relationship rel = start.createRelationshipTo(end, RelationshipType.withName(type));
propertySetter.setProperties(rel, properties);
return new RelationshipRepresentation(rel);
}
Aggregations