org.babyfish.jimmer.sql.kt.KEntities.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-sql-kotlin Show documentation
Show all versions of jimmer-sql-kotlin Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.sql.kt
import org.babyfish.jimmer.Input
import org.babyfish.jimmer.View
import org.babyfish.jimmer.lang.NewChain
import org.babyfish.jimmer.sql.fetcher.Fetcher
import org.babyfish.jimmer.sql.kt.ast.mutation.*
import org.babyfish.jimmer.sql.kt.ast.query.SortDsl
import org.babyfish.jimmer.sql.kt.ast.query.KExample
import java.sql.Connection
import kotlin.reflect.KClass
/**
* To be absolutely cache friendly,
* all query methods in this class that start with "find" ignore the global filters.
*
* The mentions here ignore global filters, only for aggregate root objects,
* excluding deeper objects fetched by object fetcher.
*/
interface KEntities : KSaver {
@NewChain
fun forUpdate() :KEntities
@NewChain
fun forConnection(con: Connection?) :KEntities
fun findById(type: KClass, id: Any): T?
fun findOneById(type: KClass, id: Any): T
fun findByIds(type: KClass, ids: Iterable<*>): List
/**
* @param [T] Entity type or output DTO type
*/
fun findMapByIds(type: KClass, ids: Iterable): Map
fun findById(fetcher: Fetcher, id: Any): E?
fun findOneById(fetcher: Fetcher, id: Any): E
fun findByIds(fetcher: Fetcher, ids: Iterable<*>): List
fun findMapByIds(fetcher: Fetcher, ids: Iterable): Map
fun findAll(type: KClass): List
fun findAll(type: KClass, block: (SortDsl.() -> Unit)? = null): List
fun > findAllViews(view: KClass, block: (SortDsl.() -> Unit) ?= null): List
fun findAll(fetcher: Fetcher, block: (SortDsl.() -> Unit)? = null): List
fun findByExample(
example: KExample,
fetcher: Fetcher? = null,
block: (SortDsl.() -> Unit)? = null
): List
fun > findByExample(
viewType: KClass,
example: KExample,
block: (SortDsl.() -> Unit)? = null
): List
fun delete(
type: KClass<*>,
id: Any,
con: Connection? = null,
block: (KDeleteCommandDsl.() -> Unit)? = null
): KDeleteResult
fun deleteAll(
type: KClass<*>,
ids: Iterable<*>,
con: Connection? = null,
block: (KDeleteCommandDsl.() -> Unit)? = null
): KDeleteResult
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy