通过子属性(RealmList)使用in()返回所有对象的Realm查询对象

时间:2017-11-22 11:59:29

标签: android realm

代码

public class Chat extends RealmObject {
  private RealmList<Contact> contactsList;
}
public class Contact extends RealmObject {
  private PhoneNumber phoneNumber;
}
public class PhoneNumber extends RealmObject {
  private String number;
}

String tArray[] = new String[]{"234234","234423432","23432423"};
RealmQuery<Chat> realmQuery  = realm.where(Chat.class).in("contactsList.phoneNumber.number",tArray);
RealmResults<Chat> chatList = realmQuery.findAll();

此查询返回所有对象,而不是数组中指定的对象。为什么呢?

0 个答案:

没有答案