@Entity
data class Product (
@PrimaryKey(autoGenerate = true)
var id: Long? = null
)
data class ProductList (
@Embedded var products: Product,
@Relation(
parentColumn = "id",
entityColumn = "productId",
entity = GroceryItem::class
)
var courses: List<GroceryItem?>? = null
)
@Entity
data class GroceryItem (
@PrimaryKey
var id: Int? = null,
var image: String? = null,
var price: String?= null
)
Here I don't have any field as common so how can I relate this two table or how can I add room autogenerated id as a foreign key