use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.
the class CountStatements method countNodes.
@Override
public CypherQuery countNodes(String label, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildNodeQuery(label, filters);
query.setReturnClause(" RETURN COUNT(n)");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.
the class NodeQueryStatements method findByType.
@Override
public PagingAndSortingQuery findByType(String label, Filters parameters, int depth) {
FilteredQuery filteredQuery = FilteredQueryBuilder.buildNodeQuery(label, parameters);
String matchClause = filteredQuery.statement();
String returnClause = loadClauseBuilder.build(label, depth);
return new PagingAndSortingQuery(matchClause, returnClause, filteredQuery.parameters(), depth != 0, true);
}
use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.
the class RelationshipDeleteStatements method delete.
@Override
public CypherQuery delete(String type, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildRelationshipQuery(type, filters);
query.setReturnClause(" DELETE r0");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.
the class RelationshipQueryStatements method findByType.
@Override
public PagingAndSortingQuery findByType(String type, Filters parameters, int depth) {
if (depth > 0) {
FilteredQuery query = FilteredQueryBuilder.buildRelationshipQuery(type, parameters);
String matchClause = query.statement() + " WITH DISTINCT(r0) as r0,startnode(r0) AS n, endnode(r0) AS m";
String returnClause = loadClauseBuilder.build("r0", type, depth);
return new PagingAndSortingQuery(matchClause, returnClause, query.parameters(), true, true, "r0");
} else {
throw new InvalidDepthException("Cannot load a relationship entity with depth 0 i.e. no start or end node");
}
}
use of org.neo4j.ogm.session.request.FilteredQuery in project neo4j-ogm by neo4j.
the class CountStatements method countEdges.
@Override
public CypherQuery countEdges(String type, Iterable<Filter> filters) {
FilteredQuery query = FilteredQueryBuilder.buildRelationshipQuery(type, filters);
query.setReturnClause(" RETURN COUNT(r0)");
return new DefaultRowModelRequest(query.statement(), query.parameters());
}
Aggregations