Thread
#exposed
    rcd27

    rcd27

    6 months ago
    [Solved] I've got a join query where I have all data I need in a ResultSet
    val innerJoin = ReceiptItems.join(Receipts, JoinType.INNER) { ReceiptItems.receiptId eq Receipts.id }
                .join(Items, JoinType.INNER) { Receipts.resultItemId eq Items.id }
    Is it possible to
    wrapRows
    for a multiple entities, like
    ReceiptEntity.wrapRows(query)
    , and others? I can extract all I need from a
    ResultSet
    , but seems like iterating with
    next()
    is a bit boilerplaty
    I came to this:
    query.map {
                val receipt = ReceiptEntity.wrapRow(it)
                val resultItem = ItemEntity.wrapRow(it)
                val receiptItem = ReceiptItemEntity.wrapRow(it)
    }
    So I can wrap each row of query
    ResultSet
    and extract data I need.