Parcelable error occurred while using the Room.
I'm studying Room, but I don't have much common sense yet. So I don't know why I use Parcelable.
I think there was an error when changing the format of Room to one to many.
error mesage :
error: (goalId) does not exist in com.example.goalapp.db.entity.Goal. Available columns are id,goalName
public final class TodayGoal implements android.os.Parcelable {
^
Entity related code :
//Goal table
@Parcelize
@Entity(tableName = "goal_table")
data class Goal(
@PrimaryKey(autoGenerate = true)
val id: Int,
val goalName: String,
): Parcelable
//todayGoal table
@Parcelize
@Entity(
tableName = "today_goal_table",
foreignKeys = [
ForeignKey(
entity = Goal::class,
parentColumns = ["goalId"],
childColumns = ["id"],
onDelete = ForeignKey.CASCADE
)
]
)
data class TodayGoal(
val id: Int,
@PrimaryKey(autoGenerate = true)
val todayGoalId: Int,
val TodayGoalName: String,
): Parcelable
//GoalAndTodayGoal
@Parcelize
data class GoalAndTodayGoals(
@Embedded val goal: Goal,
@Relation(
parentColumn = "goalId",
entityColumn = "id"
)
val todayGoals: List<TodayGoal>
): Parcelable