https://kotlinlang.org logo
#exposed
Title
# exposed
w

Wyatt Kennedy

10/11/2023, 12:40 AM
In regards to my previous question, I can't get my workaround to work either. If I have a query
(UserTable innerJoin UserDataTable)
and then try to get each entity from the result with
UserEntity.wrapRows(query)
and
UserDataEntity.wrapRows(query)
, this runs the same query twice. Is this the normal behavior of a query and is there any way to get the query to be "realized" so to speak but still be a
SizedIterable
so that I can call
wrapRows
?
2
looked in the exposed code and realized
wrapRows
literally just iterates over the
ResultRow
and calls
wrapRow
. So I just called
toList
which calls out to the db, and then used
.map { val user = UserEntity.wrapRow(it); val data = UserDataEntity.wrapRow(it); user.data = data }
. The calls to wrapRow do not trigger a fetch to the db.
🙌 1