Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace link to EIB.EMPTY to OEIB.EMPTY #205

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions query/src/main/kotlin/jetbrains/exodus/query/QueryEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -137,7 +135,7 @@ open class QueryEngine(val modelMetaData: ModelMetaData?, val persistentStore: P

open fun exclude(left: Iterable<Entity>, right: Iterable<Entity>): Iterable<Entity> {
if (left.isEmpty || left === right) {
return EMPTY
return OEntityIterableBase.EMPTY
}
if (right.isEmpty) {
return left
Expand Down Expand Up @@ -269,9 +267,9 @@ open class QueryEngine(val modelMetaData: ModelMetaData?, val persistentStore: P

private val Iterable<Entity>?.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<Entity>?.isPersistent: Boolean get() = this is EntityIterableBase
private val Iterable<Entity>?.isPersistent: Boolean get() = this is OEntityIterableBase


7 changes: 3 additions & 4 deletions query/src/main/kotlin/jetbrains/exodus/query/SortEngine.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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<Entity> {
Expand Down
Loading