api-docs / org.ktorm.entity / single
single
fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.single(): E
(source code)Return the single element, or throws an exception if the sequence is empty or has more than one element.
The operation is terminal.
inline fun <E : Any, T : BaseTable<E>> EntitySequence<E, T>.single(
predicate: (T) -> ColumnDeclaring<Boolean>
): E
(source code)Return the single element matching the given predicate, or throws exception if there is no or more than one
matching element.
The operation is terminal.