我想在“CrossRef”表中添加额外的字段。我的问题是如何让 DateWithSteaks 从“CrossRef”表中获取这个“isCompleted”变量?
@Entity
public class Steak{
@PrimaryKey(autoGenerate = true)
public int id;
public String title;
}
@Entity
public class Date {
@PrimaryKey
public long date;
public Date() {
date = new LocalDate().toDate().getTime();
}
}
@Entity(primaryKeys = {"date", "id"})
public class DateSteakCrossRef {
public long date;
public int id;
public boolean isCompleted;
}
public class DateWithSteaks {
@Embedded Date date;
@Relation(
parentColumn = "date",
entityColumn = "id",
associateBy = @Junction(DateSteakCrossRef.class)
)
public List<Steak> steaks;
}