@@ -129,6 +129,9 @@ def generateMapColumns(Writer writer, int tupleNumber) {
129129 * element. Besides, the function’s return type is a tuple of `ColumnDeclaring<C>`s, and we should return some
130130 * columns or expressions to customize the `select` clause of the generated SQL.
131131 *
132+ * Ktorm supports selecting two or more columns, we just need to wrap our selected columns by [tupleOf]
133+ * in the closure, then the function’s return type becomes `List<TupleN<C1?, C2?, .. Cn?>>`.
134+ *
132135 * The operation is terminal.
133136 *
134137 * @param isDistinct specify if the query is distinct, the generated SQL becomes `select distinct` if it's set to true.
@@ -155,6 +158,9 @@ def generateMapColumns(Writer writer, int tupleNumber) {
155158 * element. Besides, the function’s return type is a tuple of `ColumnDeclaring<C>`s, and we should return some
156159 * columns or expressions to customize the `select` clause of the generated SQL.
157160 *
161+ * Ktorm supports selecting two or more columns, we just need to wrap our selected columns by [tupleOf]
162+ * in the closure, then the function’s return type becomes `List<TupleN<C1?, C2?, .. Cn?>>`.
163+ *
158164 * The operation is terminal.
159165 *
160166 * @param destination a [MutableCollection] used to store the results.
@@ -214,6 +220,9 @@ def generateAggregateColumns(Writer writer, int tupleNumber) {
214220 * Perform a tuple of aggregations given by [aggregationSelector] for all elements in the sequence,
215221 * and return the aggregate results.
216222 *
223+ * Ktorm supports aggregating two or more columns, we just need to wrap our aggregate expressions by
224+ * [tupleOf] in the closure, then the function’s return type becomes `TupleN<C1?, C2?, .. Cn?>`.
225+ *
217226 * The operation is terminal.
218227 *
219228 * @param aggregationSelector a function that accepts the source table and returns a tuple of aggregate expressions.
@@ -302,6 +311,9 @@ def generateGroupingAggregateColumns(Writer writer, int tupleNumber) {
302311 * The key for each group is provided by the [EntityGrouping.keySelector] function, and the generated SQL is like:
303312 * `select key, aggregation from source group by key`.
304313 *
314+ * Ktorm supports aggregating two or more columns, we just need to wrap our aggregate expressions by [tupleOf]
315+ * in the closure, then the function’s return type becomes `Map<K?, TupleN<C1?, C2?, .. Cn?>>`.
316+ *
305317 * @param aggregationSelector a function that accepts the source table and returns a tuple of aggregate expressions.
306318 * @return a [Map] associating the key of each group with the results of aggregations of the group elements.
307319 * @since 3.1.0
@@ -322,6 +334,9 @@ def generateGroupingAggregateColumns(Writer writer, int tupleNumber) {
322334 * The key for each group is provided by the [EntityGrouping.keySelector] function, and the generated SQL is like:
323335 * `select key, aggregation from source group by key`.
324336 *
337+ * Ktorm supports aggregating two or more columns, we just need to wrap our aggregate expressions by [tupleOf]
338+ * in the closure, then the function’s return type becomes `Map<K?, TupleN<C1?, C2?, .. Cn?>>`.
339+ *
325340 * @param destination a [MutableMap] used to store the results.
326341 * @param aggregationSelector a function that accepts the source table and returns a tuple of aggregate expressions.
327342 * @return the [destination] map associating the key of each group with the result of aggregations of the group elements.
0 commit comments