领域-使用IN查询RealList

时间:2018-09-26 20:30:56

标签: realm realm-mobile-platform realm-list

尽管

filteredPosts的记录具有类别3,5

,但在 in 查询中,其大小始终为零
public class Post extends RealmObject{
    @PrimaryKey
    private long id;
    private String title;
    private RealmList<Integer> categories;
}

realm = Realm.getDefaultInstance();
realm.beginTransaction();
Integer cates[] = {3,5};
RealmResults<Post> filteredPosts = 
realm.where(Post.class).in("categories",cates).findAll();
realm.commitTransaction();

Log.e(TAG,filteredPosts.size()+"");

0 个答案:

没有答案