English | 简体中文

api-docs / org.ktorm.entity / mapColumnsNotNullTo

mapColumnsNotNullTo

inline fun <E : Any, T : BaseTable<E>, C : Any, R : MutableCollection<in C>> EntitySequence<E, T>.mapColumnsNotNullTo(
    destination: R,
    isDistinct: Boolean = false,
    columnSelector: (T) -> ColumnDeclaring<C>
): R
(source code)

Customize the selected columns of the internal query by the given columnSelector function, and append non-null
results to the given destination.

This function is similar to EntitySequence.mapColumnsTo, but null results are filtered, more details can be found
in its documentation.

The operation is terminal.

Parameters

destination - a MutableCollection used to store the results.

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.