Hey guys!
I'm currently working with Exposed and its a breeze! However, I stumbled upon a thing that I don't quite understand yet.
I have the following table:
object Sensors : IntIdTable() {
val roomId = reference("id", Rooms.id).nullable()
val name = text("name")
}
And now I just want to select all rows and map them to my domain Object:
class Sensor(
val id: Int?,
val roomId: Int?,
val name: String
)
Sensors.selectAll().map {
Sensor(it[id], it[roomId], it[name])
}
However, if I do it as shown, I get an alert saying that
it[id]
is of type string (while I expect an int).
Ist htere a better way? Why is it like that, even though my table definition is different?
Thanks in advance!