realm-base-adapter

Query nested Realm objects encapsulated in RealmList into RealmResults

点点圈 提交于 2020-01-14 09:44:18
问题 I have the following RealmObject: public class City extends RealmObject { private String cityId; private RealmList<Street> streets; public String getId() { return cityId; } public void setCityId(String cityId) { this.cityId = cityId; } public RealmList<Street> getStreets() { return streets; } public void setStreets(RealmList<Street> streets) { this.streets = streets; } } Now having a cityId I need to query streets of particular city. How to do that? What I did try was: Realm.getInstance