Search in sources :

Example 6 with FilteredQuery

use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.

the class NodeDeleteStatements method delete.

@Override
public CypherQuery delete(String label, Iterable<Filter> filters) {
    FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
    query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n");
    return new DefaultRowModelRequest(query.statement(), query.parameters());
}
Also used : FilteredQuery(org.neo4j.ogm.session.request.FilteredQuery) DefaultRowModelRequest(org.neo4j.ogm.cypher.query.DefaultRowModelRequest)

Example 7 with FilteredQuery

use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.

the class NodeDeleteStatements method deleteAndList.

@Override
public CypherQuery deleteAndList(String label, Iterable<Filter> filters) {
    FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
    query.setReturnClause(" OPTIONAL MATCH (n)-[r0]-() DELETE r0, n RETURN ID(n)");
    return new DefaultRowModelRequest(query.statement(), query.parameters());
}
Also used : FilteredQuery(org.neo4j.ogm.session.request.FilteredQuery) DefaultRowModelRequest(org.neo4j.ogm.cypher.query.DefaultRowModelRequest)

Example 8 with FilteredQuery

use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.

the class RelationshipDeleteStatements method deleteAndList.

@Override
public CypherQuery deleteAndList(String type, Iterable<Filter> filters) {
    FilteredQuery query = FilteredQueryBuilder.buildRelationshipQuery(type, filters);
    query.setReturnClause(" DELETE r0 RETURN ID(r0)");
    return new DefaultRowModelRequest(query.statement(), query.parameters());
}
Also used : FilteredQuery(org.neo4j.ogm.session.request.FilteredQuery) DefaultRowModelRequest(org.neo4j.ogm.cypher.query.DefaultRowModelRequest)

Aggregations

FilteredQuery (org.neo4j.ogm.session.request.FilteredQuery)8 DefaultRowModelRequest (org.neo4j.ogm.cypher.query.DefaultRowModelRequest)6 PagingAndSortingQuery (org.neo4j.ogm.cypher.query.PagingAndSortingQuery)2 InvalidDepthException (org.neo4j.ogm.exception.core.InvalidDepthException)1