Pablo
12/23/2024, 11:42 PM@Entity(tableName = "BusStops")
data class BusStopEntity(
@PrimaryKey val id: Int = 0,
val name: String,
val lat: Double,
val lon: Double
)
@Entity(tableName = "Lines")
data class LineEntity(
@PrimaryKey val id: Int = 0,
val name: String
)
@Entity(primaryKeys = ["busStopId", "lineId"])
data class BusStopLineEntity(
val busStopId: Int,
val lineId: Int
)
Pablo
12/23/2024, 11:42 PMdata class LineWithBusStops(
@Embedded val line: LineEntity,
@Relation(
parentColumn = "id",
entityColumn = "busStopId",
associateBy = Junction(BusStopLineEntity::class)
)
val busStops: List<BusStopEntity>
)
But I get an error on the @Relation
line entityColumn = "busStopId"
> Cannot find the child entity column busStopId
in com.local.model.BusStopEntity. Options: id, name, lat, lon
If I change busStopId
to id
, I got even more errors.
Any ideas?