Package-level declarations
Types
Entity extension APIs.
Wraps an EntitySequence with a keySelector function, which can be applied to each record to get its key, or used as the group by
clause of the generated SQL.
Represents a sequence of entity objects. As the name implies, the style and use pattern of Ktorm's entity sequence APIs are highly similar to kotlin.sequences.Sequence and the extension functions in Kotlin standard lib, as it provides many extension functions with the same names, such as filter, map, reduce, etc.
Functions
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map.
Group elements from the source sequence by key and perform the given aggregations for elements in each group, then store the results in a new Map.
Group elements from the source sequence by key and perform the given aggregation for elements in each group, then store the results in a new Map.
Perform a tuple of aggregations given by aggregationSelector for all elements in the sequence, and return the aggregate results.
Perform an aggregation given by aggregationSelector for all elements in the sequence, and return the aggregate result.
Group elements from the source sequence by key and perform the given aggregation for elements in each group, then store the results in the destination map.
Group elements from the source sequence by key and perform the given aggregations for elements in each group, then store the results in the destination map.
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map.
Return a Map containing the elements from the given sequence indexed by the key returned from keySelector function applied to each element.
Return a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given sequence.
Populate and return the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given sequence and value is the element itself.
Populate and return the destination mutable map with key-value pairs, where key is provided by the keySelector function and value is provided by the valueTransform function applied to elements of the given sequence.
Populate and return the destination mutable map with key-value pairs provided by transform function applied to each element of the given sequence.
Return a Map where keys are elements from the given sequence and values are produced by the valueSelector function applied to each element.
Populate and return the destination mutable map with key-value pairs for each element of the given sequence, where key is the element itself and value is provided by the valueSelector function applied to that key.
Group elements from the source sequence by key and average the columns or expressions provided by the columnSelector function for elements in each group.
Group elements from the source sequence by key and average the columns or expressions provided by the columnSelector function for elements in each group, then store the results in the destination map.
Group elements from the source sequence by key and count elements in each group, then store the results in the destination map.
Group elements from the source sequence by key and get the max value of the columns or expressions provided by the columnSelector function for elements in each group.
Group elements from the source sequence by key and get the max value of the columns or expressions provided by the columnSelector function for elements in each group, then store the results in the destination map.
Group elements from the source sequence by key and get the min value of the columns or expressions provided by the columnSelector function for elements in each group.
Group elements from the source sequence by key and get the min value of the columns or expressions provided by the columnSelector function for elements in each group, then store the results in the destination map.
Group elements from the source sequence by key and sum the columns or expressions provided by the columnSelector function for elements in each group, then store the results in the destination map.
Return a sequence customizing the selected columns of the internal query.
Append all elements not matching the given predicate to the given destination.
Append all elements matching the given predicate to the given destination.
Return the first element, or throws NoSuchElementException if the sequence is empty.
Return the first element matching the given predicate, or throws NoSuchElementException if element was not found.
Return the first element, or null
if the sequence is empty.
Return the first element matching the given predicate, or null
if element was not found.
Append all elements yielded from results of transform function being invoked on each element and its index in the original sequence, to the given destination.
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is the same initialValue for each group.
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is provided by initialValueSelector function.
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is the same initialValue for each group.
Groups elements from the source sequence by key and applies operation to the elements of each group sequentially, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is provided by initialValueSelector function.
Perform the given action on each element, providing sequential index with the element.
Group elements of the original sequence by the key returned by the given keySelector function applied to each element and return a map where each group key is associated with a list of corresponding elements.
Group values returned by the valueTransform function applied to each element of the original sequence by the key returned by the given keySelector function applied to the element and returns a map where each group key is associated with a list of corresponding values.
Group elements of the original sequence by the key returned by the given keySelector function applied to each element and put to the destination map each group key associated with a list of corresponding elements.
Group values returned by the valueTransform function applied to each element of the original sequence by the key returned by the given keySelector function applied to the element and put to the destination map each group key associated with a list of corresponding values.
Create an EntityGrouping from the sequence to be used later with one of group-and-fold operations.
Return true
if the sequence has at lease one element.
Return the last element, or throws NoSuchElementException if the sequence is empty.
Return the last element matching the given predicate, or throws NoSuchElementException if no such element found.
Return the last element, or null
if the sequence is empty.
Return the last element matching the given predicate, or null
if no such element was found.
Customize the selected columns of the internal query by the given columnSelector function, and return a List containing the query results.
Customize the selected columns of the internal query by the given columnSelector function, and return a List containing the non-null results.
Customize the selected columns of the internal query by the given columnSelector function, and append non-null results to the given destination.
Customize the selected columns of the internal query by the given columnSelector function, and append the query results to the given destination.
Apply the given transform function to each element and its index in the original sequence and append only the non-null results to the given destination.
Apply the given transform function to each element and its index in the original sequence and append the results to the given destination.
Apply the given transform function to each element in the original sequence and append only the non-null results to the given destination.
Groups elements from the source sequence by key and applies the reducing operation to the elements of each group sequentially starting from the second element of the group, passing the previously accumulated value and the current element as arguments, and stores the results in a new map. An initial value of accumulator is the first element of the group.
Accumulate value starting with the first element and applying operation from left to right to current accumulator value and each element.
Accumulate value starting with the first element and applying operation from left to right to current accumulator value and each element.
Groups elements from the source sequence by key and applies the reducing operation to the elements of each group sequentially starting from the second element of the group, passing the previously accumulated value and the current element as arguments, and stores the results in the given destination map. An initial value of accumulator is the first element of the group.
Create an EntitySequence from the specific table.
Return the single element, or throws an exception if the sequence is empty or has more than one element.
Return the single element matching the given predicate, or throws exception if there is no or more than one matching element.
Return single element, or null
if the sequence is empty or has more than one element.
Return the single element matching the given predicate, or null
if element was not found or more than one element was found.
Return a sequence sorting elements by multiple columns, in ascending or descending order. For example, sortedBy({ it.col1.asc() }, { it.col2.desc() })
.
Return a sequence sorting elements by a column, in ascending or descending order. For example, sortedBy { it.col.asc() }
Return a sequence sorting elements by the specific column in ascending order.
Return a sequence sorting elements by the specific column in descending order.
Append all elements to the given destination collection.
Return a List containing all the elements of this sequence.
Convert this tuple into a list.
Return a MutableList containing all the elements of this sequence.
Return a MutableSet containing all the elements of this sequence.
Return a SortedSet containing all the elements of this sequence.
Create a tuple of 2 values.
Create a tuple of 3 values.
Create a tuple of 4 values.
Create a tuple of 5 values.
Create a tuple of 6 values.
Create a tuple of 7 values.
Create a tuple of 8 values.
Create a tuple of 9 values.
Return a lazy Sequence that wraps each element of the original sequence into an IndexedValue containing the index of that element and the element itself.