【发布时间】:2017-04-12 16:50:29
【问题描述】:
我有 2 个这样的模型:
@Entity
public class Book {
@Id
Long _id;
String name;
@ToMany(referencedJoinProperty = "bookId")
List<Chapter> chapters1;
@ToMany(referencedJoinProperty = "bookId")
List<Chapter> chapters2;
}
@Entity
public class Chapter {
@Id
Long _id;
String name;
int type;
long bookId;
@ToOne(joinProperty = "bookId")
Book book;
}
目前有2种类型的章节type1和2,目前,当我得到champions1时,greenDAO返回所有type1和2,我怎样才能在类Book中只得到type1或2?
【问题讨论】: