Search in sources :

Example 1 with ORecordIteratorClassDescendentOrder

use of com.orientechnologies.orient.core.iterator.ORecordIteratorClassDescendentOrder in project orientdb by orientechnologies.

the class OCommandExecutorSQLResultsetAbstract method searchInClasses.

protected Iterator<? extends OIdentifiable> searchInClasses(final OClass iCls, final boolean iPolymorphic, final boolean iAscendentOrder) {
    final ODatabaseDocumentInternal database = getDatabase();
    database.checkSecurity(ORule.ResourceGeneric.CLASS, ORole.PERMISSION_READ, iCls.getName().toLowerCase(Locale.ENGLISH));
    final ORID[] range = getRange();
    if (iAscendentOrder)
        return new ORecordIteratorClass<ORecord>(database, database, iCls.getName(), iPolymorphic, isUseCache(), false).setRange(range[0], range[1]);
    else
        return new ORecordIteratorClassDescendentOrder<ORecord>(database, database, iCls.getName(), iPolymorphic).setRange(range[0], range[1]);
}
Also used : ORecordIteratorClass(com.orientechnologies.orient.core.iterator.ORecordIteratorClass) ORID(com.orientechnologies.orient.core.id.ORID) ORecordIteratorClassDescendentOrder(com.orientechnologies.orient.core.iterator.ORecordIteratorClassDescendentOrder) ODatabaseDocumentInternal(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)

Example 2 with ORecordIteratorClassDescendentOrder

use of com.orientechnologies.orient.core.iterator.ORecordIteratorClassDescendentOrder in project orientdb by orientechnologies.

the class OSelectStatement method searchInClasses.

protected Iterator<? extends OIdentifiable> searchInClasses(final OClass iCls, final boolean iPolymorphic, final boolean iAscendentOrder) {
    final ODatabaseDocumentInternal database = getDatabase();
    database.checkSecurity(ORule.ResourceGeneric.CLASS, ORole.PERMISSION_READ, iCls.getName().toLowerCase(Locale.ENGLISH));
    // TODO
    final ORID[] range = new ORID[2];
    // TODO
    boolean useCache = false;
    if (iAscendentOrder)
        return new ORecordIteratorClass<ORecord>(database, database, iCls.getName(), iPolymorphic, useCache, false).setRange(range[0], range[1]);
    else
        return new ORecordIteratorClassDescendentOrder<ORecord>(database, database, iCls.getName(), iPolymorphic).setRange(range[0], range[1]);
}
Also used : ORecordIteratorClass(com.orientechnologies.orient.core.iterator.ORecordIteratorClass) ORID(com.orientechnologies.orient.core.id.ORID) ORecordIteratorClassDescendentOrder(com.orientechnologies.orient.core.iterator.ORecordIteratorClassDescendentOrder) ODatabaseDocumentInternal(com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)

Aggregations

ODatabaseDocumentInternal (com.orientechnologies.orient.core.db.ODatabaseDocumentInternal)2 ORID (com.orientechnologies.orient.core.id.ORID)2 ORecordIteratorClass (com.orientechnologies.orient.core.iterator.ORecordIteratorClass)2 ORecordIteratorClassDescendentOrder (com.orientechnologies.orient.core.iterator.ORecordIteratorClassDescendentOrder)2