use of org.neo4j.graphdb.Direction in project jo-client-platform by jo-source.
the class SyncNeo4JSimpleRelatedReaderServiceImpl method getAllRelatedNodes.
private List<Tuple<Node, Relationship>> getAllRelatedNodes(final List<Tuple<Node, Relationship>> parentNodes, final Tuple<RelationshipType, Direction> relation, final IExecutionCallback executionCallback) {
final List<Tuple<Node, Relationship>> result = new LinkedList<Tuple<Node, Relationship>>();
final RelationshipType relationshipType = relation.getFirst();
final Direction direction = relation.getSecond();
for (final Tuple<Node, Relationship> parentNodeTuple : parentNodes) {
CapServiceToolkit.checkCanceled(executionCallback);
final Node parentNode = parentNodeTuple.getFirst();
for (final Relationship relationship : parentNode.getRelationships(direction, relationshipType)) {
CapServiceToolkit.checkCanceled(executionCallback);
result.add(new Tuple<Node, Relationship>(relationship.getOtherNode(parentNode), relationship));
}
}
return result;
}
Aggregations