我有这样的父领域对象:
public class Parentdb extends RealmObject {
@PrimaryKey
public long id;
RealmList<Child> childs;
}
我想从父母那里删除所有孩子,因为我使用了这个代码:
realm.beginTransaction();
parentdb.childs.deleteAllFromRealm();
realm.commitTransaction();
Child child=realm.where(Child.class).findFirst();
运行此代码后,孩子必须为空,对吗?
但它不是!
难道我做错了什么?