Hey I'm using one model as DTO, JsonCreator and Percelize my problem is that i want to use polymorphism (disassemble common part) and have no idea how to write it in Kotlin.
@Parcelize
@Entity
open class Location (var lat: Double = 0.0, var lng: Double = 0.0) :Parcelable
@Parcelize
@Entity
class MapsMarker(lat: Double, lng: Double, var name: String): Location(lat, lng), Parcelable
An issue here is that compiles shouts
Parcelizable constructor parameter should be "var or val"
for fields lat, lng of MapsMarker.
I'm using inheritance so I can't use val because I will override properties of the Location class. I also dont want my room @Entity will have duplicated fields.
If anyone knows the answer please help me ;)