if (!edgesLoaded) {
if (ids.length > 0) {
Set<Object> identifiers = Arrays.stream(ids).map(Neo4JSession::processIdentifier).collect(Collectors.toSet());
List<Object> filter = identifiers.stream().filter(id -> !edges.containsKey(id)).collect(Collectors.toList());
if (!filter.isEmpty()) {
<BUG>Statement statement = new Statement("MATCH " + generateVertexMatch("n") + "-[r]->" + generateVertexMatch("m") + " WHERE r." + edgeIdFieldName + " in {ids} RETURN n, r, m", Values.parameters("ids", filter));
Stream<Edge> query = edges(statement);</BUG>
return combine(identifiers.stream().filter(edges::containsKey).map(id -> (Edge)edges.get(id)), query);
}
return combine(identifiers.stream().filter(edges::containsKey).map(id -> (Edge)edges.get(id)), Stream.empty());

if (!edgesLoaded) {
if (ids.length > 0) {
Set<Object> identifiers = Arrays.stream(ids).map(Neo4JSession::processIdentifier).collect(Collectors.toSet());
List<Object> filter = identifiers.stream().filter(id -> !edges.containsKey(id)).collect(Collectors.toList());
if (!filter.isEmpty()) {
String outVertexPredicate = partition.generateVertexMatchPredicate("n");
String inVertexPredicate = partition.generateVertexMatchPredicate("m");
Statement statement = new Statement("MATCH " + generateVertexMatchPattern("n") + "-[r]->" + generateVertexMatchPattern("m") + " WHERE r." + edgeIdFieldName + " in {ids}" + (outVertexPredicate != null && inVertexPredicate != null ? " AND " + outVertexPredicate + " AND " + inVertexPredicate : "") + " RETURN n, r, m", Values.parameters("ids", filter));
Stream<Edge> query = edges(statement);
return combine(identifiers.stream().filter(edges::containsKey).map(id -> (Edge)edges.get(id)), query);
}
return combine(identifiers.stream().filter(edges::containsKey).map(id -> (Edge)edges.get(id)), Stream.empty());
