mapColumns

@JvmName(name = "_mapColumns2")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple2<ColumnDeclaring<C1>, ColumnDeclaring<C2>>): List<Tuple2<C1?, C2?>>
@JvmName(name = "_mapColumns3")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple3<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>>): List<Tuple3<C1?, C2?, C3?>>
@JvmName(name = "_mapColumns4")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple4<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>>): List<Tuple4<C1?, C2?, C3?, C4?>>
@JvmName(name = "_mapColumns5")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any, C5 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple5<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>, ColumnDeclaring<C5>>): List<Tuple5<C1?, C2?, C3?, C4?, C5?>>
@JvmName(name = "_mapColumns6")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any, C5 : Any, C6 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple6<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>, ColumnDeclaring<C5>, ColumnDeclaring<C6>>): List<Tuple6<C1?, C2?, C3?, C4?, C5?, C6?>>
@JvmName(name = "_mapColumns7")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any, C5 : Any, C6 : Any, C7 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple7<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>, ColumnDeclaring<C5>, ColumnDeclaring<C6>, ColumnDeclaring<C7>>): List<Tuple7<C1?, C2?, C3?, C4?, C5?, C6?, C7?>>
@JvmName(name = "_mapColumns8")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any, C5 : Any, C6 : Any, C7 : Any, C8 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple8<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>, ColumnDeclaring<C5>, ColumnDeclaring<C6>, ColumnDeclaring<C7>, ColumnDeclaring<C8>>): List<Tuple8<C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?>>
@JvmName(name = "_mapColumns9")
inline fun <E : Any, T : BaseTable<E>, C1 : Any, C2 : Any, C3 : Any, C4 : Any, C5 : Any, C6 : Any, C7 : Any, C8 : Any, C9 : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> Tuple9<ColumnDeclaring<C1>, ColumnDeclaring<C2>, ColumnDeclaring<C3>, ColumnDeclaring<C4>, ColumnDeclaring<C5>, ColumnDeclaring<C6>, ColumnDeclaring<C7>, ColumnDeclaring<C8>, ColumnDeclaring<C9>>): List<Tuple9<C1?, C2?, C3?, C4?, C5?, C6?, C7?, C8?, C9?>>

Customize the selected columns of the internal query by the given columnSelector function, and return a List containing the query results.

This function is similar to EntitySequence.map, but the columnSelector closure accepts the current table object T as the parameter, so what we get in the closure by it is the table object instead of an entity element. Besides, the closure’s return type is a tuple of ColumnDeclaring<C>s, and we should return some columns or expressions to customize the select clause of the generated SQL.

Ktorm supports selecting two or more columns, we just need to wrap our selected columns by tupleOf in the closure, then the function’s return type becomes List<TupleN<C1?, C2?, .. Cn?>>.

The operation is terminal.

Return

a list of the query results.

Since

3.1.0

Parameters

isDistinct

specify if the query is distinct, the generated SQL becomes select distinct if it's set to true.

columnSelector

a function in which we should return a tuple of columns or expressions to be selected.


inline fun <E : Any, T : BaseTable<E>, C : Any> EntitySequence<E, T>.mapColumns(isDistinct: Boolean = false, columnSelector: (T) -> ColumnDeclaring<C>): List<C?>(source)

Customize the selected columns of the internal query by the given columnSelector function, and return a List containing the query results.

This function is similar to EntitySequence.map, but the columnSelector closure accepts the current table object T as the parameter, so what we get in the closure by it is the table object instead of an entity element. Besides, the function’s return type is ColumnDeclaring<C>, and we should return a column or expression to customize the select clause of the generated SQL.

Ktorm also supports selecting two or more columns, we just need to wrap our selected columns by tupleOf in the closure, then the function’s return type becomes List<TupleN<C1?, C2?, .. Cn?>>.

The operation is terminal.

Return

a list of the query results.

Parameters

isDistinct

specify if the query is distinct, the generated SQL becomes select distinct if it's set to true.

columnSelector

a function in which we should return a column or expression to be selected.