Václav Benes
11/15/2023, 9:45 PMPhones
and another Operations
. I have 1:N relationship.
class PhoneDao(id: EntityID<Long>) : LongEntity(id) {
companion object : LongEntityClass<PhoneDao>(PhoneTable)
...
val operations by OperationsDao referrersOn OperationsTable.deviceId
and
data object OperationsTable : LongIdTable("Operations") {
val deviceId = reference("device_id", PhoneTable)
...
}
class OperationsDao(id: EntityID<Long>) : LongEntity(id) {
companion object : LongEntityClass<OperationsDao>(OperationsTable)
var deviceId by OperationsTable.deviceId
and issue is I have stored device_id as compound string Type_id
type - string prefix in my case is Phone
and id
relates to id from phones. Complete device_id string is Phone_1
. I need to somehow cast or transform Phone.id.toString()
https://pl.kotl.in/N5CQhMyfE