extensions.chain.QueryChainExtensions.kt Maven / Gradle / Ivy
package com.mybatisflex.kotlin.extensions.chain
import com.mybatisflex.core.query.QueryChain
inline fun QueryChain(): QueryChain = QueryChain.of(T::class.java)
fun QueryChain<*>.toList(): List<*> = list()
@JvmName("toListAs")
inline fun QueryChain<*>.toList(): List = listAs(T::class.java)
inline fun QueryChain<*>.toTypedList(): List = objListAs(T::class.java)
fun QueryChain.single(): T = one()
fun QueryChain.singleOrNull(): T? = one()
inline fun QueryChain<*>.singleAs(): T = oneAs(T::class.java)
inline fun QueryChain<*>.singleAsOrNull(): T? = oneAs(T::class.java)