I have a simple query
1/ RealmQuery<PersonEntity> query = query realm.where(PersonEntity.class).equalTo("active", Boolean.TRUE);
2/ query = query.beginGroup();
3/ query = query.beginGroup();
4/ query = query.in("services.profiles.role", allowedRoles);
5/ query = query.in("services.code", allowedCodes);
6/ query = query.endGroup();
7/ query = query.or();
8/ query = query.beginGroup();
9/ query = query.in("id", allowedIds);
10/ query = query.endGroup();
11/ query = query.endGroup();
My idea is to make a sql-like query :
SELECT * FROM person
WHERE active = true
AND ((role IN (...) AND code in (...)) OR id in (...))
I have some other groups than can come between 1/ and 2/ that's why I'm grouping.
allowedRoles has one record and
allowedIds has one record I got the result I want : everyone that has (at least one of the roles and at least one the codes) OR (has it's id in
allowedRoles has more than one record, I have an empty result.
I must miss something in my request but I don't get it.
PersonEntity has a RealmList of
PersonServiceEntityhas a RealmList of