public long getDocumentCount(String docType) { activateOnCurrentThread(); return db.countClass(docType); }
public long execute(final ODatabaseDocumentTx db) { checkNotNull(db); return db.countClass(type); }
public long countEdges() { if (useLightweightEdges) throw new UnsupportedOperationException( "Graph set to use Lightweight Edges, count against edges is not supported"); return getRawGraph().countClass(OrientEdge.CLASS_NAME); }
public long countVertices(final String iClassName) { return getRawGraph().countClass(iClassName); }
public long countEdges(final String iClassName) { if (useLightweightEdges) throw new UnsupportedOperationException( "Graph set to use Lightweight Edges, count against edges is not supported"); return getRawGraph().countClass(iClassName); }
public long countVertices() { return getRawGraph().countClass(OrientVertex.CLASS_NAME); }
public long getDocumentCount(String docType) { activateOnCurrentThread(); return db.countClass(docType); }
/** * Counts the vertices in graph of a particular class. * * @return Long as number of total vertices */ public long countVertices(final String iClassName) { makeActive(); return getRawGraph().countClass(iClassName); }
/** * Counts the edges in graph of a particular class. Edge counting works only if useLightweightEdges is false. * * @return Long as number of total edges */ public long countEdges(final String iClassName) { makeActive(); if (isUseLightweightEdges()) throw new UnsupportedOperationException("Graph set to use Lightweight Edges, count against edges is not supported"); return getRawGraph().countClass(iClassName); }
@Override public long count(final RecordQuery query) { checkOpen(); checkNotNull(query); checkType(query.getType()); if (query.getFilter().isEmpty()) { return db.countClass(query.getType().getName()); } String queryText = new OrientQueryBuilder( query, checkOrientClass(query.getType().getName()), recordIdObfuscator) .withCount(true) .build(); List<ODocument> results = db.query(new OSQLSynchQuery<>(queryText), getOrientFilter(query.getFilter())); return results.get(0).field("COUNT"); }