@Entity
data class User(
@PrimaryKey
val id: Int,
val petsId: List<String>
)
@Entity
data class Pet(
@PrimaryKey
val id: Int,
val name: String
)
如何使用Room从两个User和Pet实体获取UserWithPets?
data class UserWithPets(
val id: Int,
val pets: List<Pet>
)