I am using Room and Kotlin data class. Such as,
@Entity(tableName = "Person")
@Parcelize
class Test(@ColumnInfo(name = "name") var name:String) : Parcelable{
@PrimaryKey(autoGenerate = true)
@ColumnInfo(name = "ID")
var id: Long? = null
}
I can create the instance using the constructor and insert the data. I am also getting a warning "property would not be serialized into a 'parcel'"
. When I was trying to send the object through a bundle, the id is missing, which is expected as the warning says so. How can I add that member ID
in the parcel? I am not keeping the ID in the constructor as I want them to be generated automatically.