本文整理汇总了Java中com.orientechnologies.orient.core.iterator.ORecordIteratorClass类的典型用法代码示例。如果您正苦于以下问题:Java ORecordIteratorClass类的具体用法?Java ORecordIteratorClass怎么用?Java ORecordIteratorClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ORecordIteratorClass类属于com.orientechnologies.orient.core.iterator包,在下文中一共展示了ORecordIteratorClass类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: browseClass
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; //导入依赖的package包/类
private void browseClass(final ODatabaseDocumentTx db, final Class<? extends DocumentObject> documentObject, final JsonObjectBuilder counts) {
final String documentClassName = DocumentObject.documentClassName(documentObject);
if (db.getMetadata().getSchema().getClass(documentClassName) == null) {
counts.add(documentClassName, -1);
return;
}
final ORecordIteratorClass<ODocument> it = db.browseClass(documentClassName);
if (it.hasNext()) {
it.next();
counts.add(documentClassName, 1);
} else {
counts.add(documentClassName, 0);
}
}
示例2: elements
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; //导入依赖的package包/类
protected <A extends Element> Iterator<A> elements(String elementClass, Function<ORecord, A> toA, Object... elementIds) {
boolean polymorphic = true;
if (elementIds.length == 0) {
// return all vertices as stream
Iterator<ORecord> itty = new ORecordIteratorClass<>(database, database, elementClass, polymorphic);
return asStream(itty).map(toA).iterator();
} else {
Stream<ORID> ids = Stream.of(elementIds).map(OrientGraph::createRecordId).peek(id -> checkId(id));
Stream<ORecord> records = ids.filter(ORID::isValid).map(id -> getRecord(id)).filter(r -> r != null);
return records.map(toA).iterator();
}
}
示例3: findResources
import com.orientechnologies.orient.core.iterator.ORecordIteratorClass; //导入依赖的package包/类
@NotNull
@Override
public Observable<Resource> findResources(@NotNull RClass rClass) {
return Observable.create(subscriber -> {
subscriber.onStart();
try (ODatabaseDocument conn = getConnection()) {
ORecordIteratorClass<ODocument> it = conn.browseClass(schemaMapping.getRTypeMapping(rClass).getOClassName());
StreamSupport.stream(it.spliterator(), false)
.map(documentMapper::loadResource)
.forEach(subscriber::onNext);
}
subscriber.onCompleted();
});
}