use of org.neo4j.ogm.cypher.compiler.builders.statement.ExistingRelationshipStatementBuilder in project neo4j-ogm by neo4j.
the class MultiStatementCypherCompiler method updateRelationshipStatements.
@Override
public List<Statement> updateRelationshipStatements() {
assertStatementFactoryExists();
if (existingRelationshipBuilders.isEmpty()) {
return Collections.emptyList();
}
Map<Boolean, Set<Edge>> collect = existingRelationshipBuilders.values().stream().collect(partitioningBy(RelationshipBuilder::isDirty, Collectors.mapping(RelationshipBuilder::edge, Collectors.toSet())));
List<Statement> result = new ArrayList<>();
if (!collect.get(true).isEmpty()) {
ExistingRelationshipStatementBuilder builder = new ExistingRelationshipStatementBuilder(collect.get(true), statementFactory, true);
result.add(builder.build());
}
if (!collect.get(false).isEmpty()) {
ExistingRelationshipStatementBuilder builder = new ExistingRelationshipStatementBuilder(collect.get(false), statementFactory, false);
result.add(builder.build());
}
return result;
}
Aggregations