2
如何使用realm.io遞歸刪除具有一對多關係的記錄?如何使用realm.io(Java/Android)遞歸刪除記錄?
例如我有以下嵌套對象:
public class RealmUnit extends RealmObject {
private int id;
private RealmList<RealmChapter> chapters;
public RealmUnit() {
chapters = new RealmList<>();
}
public class RealmChapter extends RealmObject {
private int id;
private RealmList<RealmChapterGoal> chapterGoals;
public RealmChapter() {
chapterGoals = new RealmList<>();
}
}
public class RealmChapterGoal extends RealmObject {
private String type;
private String text;
public RealmChapterGoal() {}
}
removeFromRealm();已經摺舊了,使用deleteFromRealm();代替。 – DoctorD