https://kotlinlang.org logo
b

bitkid

04/28/2019, 10:50 AM
hey guys! i am trying exposed for the first time and i have question. are you following a certain pattern when converting DAOs to immutable entity objects? i have a PlayerDAO and atm i do
PlayerDAO.find { Players.email eq "someEmail" }.map { it.toPlayer() }
. is that a sane approach just adding a method to the DAO which does the conversion?
Player is a data class btw
t

tapac

04/29/2019, 10:08 AM
You have to write your own
.toPlayer()
function, there is no such functionality yet. See https://github.com/JetBrains/Exposed/issues/24 , https://github.com/JetBrains/Exposed/issues/497
b

bitkid

04/29/2019, 5:13 PM
thx! exactly my question 🙂
5 Views