All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.exposed.dao.View.kt Maven / Gradle / Ivy

There is a newer version: 0.57.0
Show newest version
package org.jetbrains.exposed.dao

import org.jetbrains.exposed.sql.Expression
import org.jetbrains.exposed.sql.Op
import org.jetbrains.exposed.sql.SizedIterable
import org.jetbrains.exposed.sql.SortOrder
import kotlin.reflect.KProperty

class View> (val op: Op, val factory: EntityClass<*, Target>) : SizedIterable {
    override fun limit(n: Int, offset: Long): SizedIterable = factory.find(op).limit(n, offset)
    override fun count(): Long = factory.find(op).count()
    override fun empty(): Boolean = factory.find(op).empty()
    override fun forUpdate(): SizedIterable = factory.find(op).forUpdate()
    override fun notForUpdate(): SizedIterable = factory.find(op).notForUpdate()

    override operator fun iterator(): Iterator = factory.find(op).iterator()
    operator fun getValue(o: Any?, desc: KProperty<*>): SizedIterable = factory.find(op)
    override fun copy(): SizedIterable = View(op, factory)
    override fun orderBy(vararg order: Pair, SortOrder>): SizedIterable = factory.find(op).orderBy(*order)
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy