@Entity(tableName = "subscription")
data class Subscription(
@PrimaryKey val planId: Int,
@ColumnInfo(name = "plan_name") val planName: String? = null,
@ColumnInfo(name = "plan_description") val planDescription: String? = null,
@ColumnInfo(name = "plan_reg_fee") val planRegFee: String? = null,
@ColumnInfo(name = "plan_monthly_charge") val planMonthlyCharge: String? = null
)
data class Benefit(
@ColumnInfo(name = "benefit_id") val benefitId: Int? = null,
@ColumnInfo(name = "benefit_code") val benefitCode: Int? = null,
@ColumnInfo(name = "benefit_name") val benefitName: String? = null,
@ColumnInfo(name = "benefit_status") val benefitStatus: String? = null
)
如何在“订阅”中获取福利列表,即
val benefitList: LiveData<List<Benefit>>? = null
使用房间关系