【发布时间】:2020-07-08 08:23:02
【问题描述】:
@Entity(tableName = "gym_address_table")
data class GymAddress(@PrimaryKey val id: String, val country: Country, val unitNumber: String)
@Entity(tableName = "country_table")
data class Country(
@PrimaryKey
val id: String,
val isoCode: String,
val dialCode: String,
val name: String,
val flagPhoto: String
)
所以,当我尝试编译这个时,我得到了这个错误:
Cannot figure out how to save this field into database. You can consider adding a type converter for it.
private final com.gymapp.main.data.model.country.Country country = null;```
我是 Room 实施的新手,所以我不知道如何解决这个问题。
【问题讨论】:
标签: android database kotlin android-room