diff --git a/query/src/main/kotlin/jetbrains/exodus/query/QueryEngine.kt b/query/src/main/kotlin/jetbrains/exodus/query/QueryEngine.kt index 38e657c00..6f191f3a7 100644 --- a/query/src/main/kotlin/jetbrains/exodus/query/QueryEngine.kt +++ b/query/src/main/kotlin/jetbrains/exodus/query/QueryEngine.kt @@ -20,8 +20,6 @@ import jetbrains.exodus.entitystore.EntityIterable import jetbrains.exodus.entitystore.PersistentEntityStore import jetbrains.exodus.entitystore.StoreTransaction import jetbrains.exodus.entitystore.iterate.EntityIdSet -import jetbrains.exodus.entitystore.iterate.EntityIterableBase -import jetbrains.exodus.entitystore.iterate.EntityIterableBase.EMPTY import jetbrains.exodus.entitystore.iterate.SingleEntityIterable import jetbrains.exodus.entitystore.orientdb.OEntityIterable import jetbrains.exodus.entitystore.orientdb.OEntityStore @@ -91,7 +89,7 @@ open class QueryEngine(val modelMetaData: ModelMetaData?, val persistentStore: P return left } if (left.isEmpty || right.isEmpty) { - return EMPTY + return OEntityIterableBase.EMPTY } return if (left is EntityIterable && right is EntityIterable) { @Suppress("USELESS_CAST") @@ -137,7 +135,7 @@ open class QueryEngine(val modelMetaData: ModelMetaData?, val persistentStore: P open fun exclude(left: Iterable, right: Iterable): Iterable { if (left.isEmpty || left === right) { - return EMPTY + return OEntityIterableBase.EMPTY } if (right.isEmpty) { return left @@ -269,9 +267,9 @@ open class QueryEngine(val modelMetaData: ModelMetaData?, val persistentStore: P private val Iterable?.isEmpty: Boolean get() { - return this == null || this === EMPTY || this is StaticTypedIterableDecorator && decorated === EMPTY + return this == null || this === OEntityIterableBase.EMPTY || this is StaticTypedIterableDecorator && decorated === OEntityIterableBase.EMPTY } -private val Iterable?.isPersistent: Boolean get() = this is EntityIterableBase +private val Iterable?.isPersistent: Boolean get() = this is OEntityIterableBase diff --git a/query/src/main/kotlin/jetbrains/exodus/query/SortEngine.kt b/query/src/main/kotlin/jetbrains/exodus/query/SortEngine.kt index 696f8e6ae..62b066d54 100644 --- a/query/src/main/kotlin/jetbrains/exodus/query/SortEngine.kt +++ b/query/src/main/kotlin/jetbrains/exodus/query/SortEngine.kt @@ -18,7 +18,6 @@ package jetbrains.exodus.query import jetbrains.exodus.entitystore.ComparableGetter import jetbrains.exodus.entitystore.Entity import jetbrains.exodus.entitystore.EntityIterable -import jetbrains.exodus.entitystore.iterate.EntityIterableBase import jetbrains.exodus.entitystore.orientdb.OEntityIterable import jetbrains.exodus.entitystore.orientdb.OVertexEntity import jetbrains.exodus.entitystore.orientdb.iterate.OEntityIterableBase @@ -46,7 +45,7 @@ open class SortEngine { } val i = queryEngine.toEntityIterable(source) if (queryEngine.isPersistentIterable(i)) { - val it = (i as EntityIterableBase).source + val it = (i as OEntityIterableBase).unwrap() if (it === OEntityIterableBase.EMPTY) { OEntityIterableBase.EMPTY } @@ -122,7 +121,7 @@ open class SortEngine { queryEngine.assertOperational() val emd = mmd?.getEntityMetaData(entityType) var it = if (emd != null && emd.isAbstract) - EntityIterableBase.EMPTY + OEntityIterableBase.EMPTY else queryEngine.instantiateGetAll(entityType) if (emd != null) { @@ -138,7 +137,7 @@ open class SortEngine { } private interface IterableGetter { - fun getIterable(type: String): EntityIterableBase + fun getIterable(type: String): OEntityIterableBase } private class EntityComparator(private val selector: ComparableGetter) : Comparator {