use of org.neo4j.ogm.session.request.strategy.impl.RelationshipDeleteStatements in project neo4j-ogm by neo4j.
the class DeleteDelegate method delete.
public <T> Object delete(Class<T> clazz, Iterable<Filter> filters, boolean listResults) {
ClassInfo classInfo = session.metaData().classInfo(clazz.getSimpleName());
if (classInfo != null) {
resolvePropertyAnnotations(clazz, filters);
CypherQuery query;
if (classInfo.isRelationshipEntity()) {
query = new RelationshipDeleteStatements().deleteAndList(classInfo.neo4jName(), filters);
} else {
query = new NodeDeleteStatements().deleteAndList(classInfo.neo4jName(), filters);
}
if (listResults) {
return list(query, classInfo.isRelationshipEntity());
}
return count(query, classInfo.isRelationshipEntity());
}
throw new RuntimeException(clazz.getName() + " is not a persistable class");
}
Aggregations