use of org.structr.bolt.index.NodeResultStream in project structr by structr.
the class BoltDatabaseService method getNodesByLabel.
@Override
public QueryResult<Node> getNodesByLabel(final String type) {
if (type == null) {
return getAllNodes();
}
final StringBuilder buf = new StringBuilder();
buf.append("MATCH (n");
if (tenantId != null) {
buf.append(":");
buf.append(tenantId);
}
buf.append(":");
buf.append(type);
buf.append(") RETURN n");
return QueryUtils.map(new NodeNodeMapper(this), new NodeResultStream(this, new SimpleCypherQuery(buf.toString())));
}
use of org.structr.bolt.index.NodeResultStream in project structr by structr.
the class BoltDatabaseService method getNodesByTypeProperty.
@Override
public QueryResult<Node> getNodesByTypeProperty(final String type) {
if (type == null) {
return getAllNodes();
}
final StringBuilder buf = new StringBuilder();
buf.append("MATCH (n");
if (tenantId != null) {
buf.append(":");
buf.append(tenantId);
}
buf.append(") WHERE n.type = {type} RETURN n");
final SimpleCypherQuery query = new SimpleCypherQuery(buf.toString());
query.getParameters().put("type", type);
// return QueryUtils.map(mapper, tx.getNodes("MATCH (n) WHERE n.type = {type} RETURN n", map));
return QueryUtils.map(new NodeNodeMapper(this), new NodeResultStream(this, query));
}
use of org.structr.bolt.index.NodeResultStream in project structr by structr.
the class BoltDatabaseService method getAllNodes.
@Override
public QueryResult<Node> getAllNodes() {
final StringBuilder buf = new StringBuilder();
buf.append("MATCH (n");
if (tenantId != null) {
buf.append(":");
buf.append(tenantId);
}
buf.append(") RETURN n");
return QueryUtils.map(new NodeNodeMapper(this), new NodeResultStream(this, new SimpleCypherQuery(buf.toString())));
}
Aggregations