android - Realm query for all entities that have a field with a certain value -


sorry if title vague, didn't know how else describe it.

i making android application in users can browse list of events @ festival, click on them more detailed overview of event , it's performance times.

here's java model:

public class festivalentity extends realmobject {     @primarykey     public string code;     public string description;     public string title;     public int minimumage;     public string squareimage;     public string landscapeimage;     public realmlist<performanceentity> performances;     public date firstperformance; }  public class performanceentity extends realmobject {     public date start;     public date end;     public double price;     public boolean favorite; } 

my question is: how make query finds festivalentitys have performanceentity favorite? can't select individual performanceentity because there no primary key performanceentity table.

what looking similar (invalid) query:

//should return list of festivalentity's contain @ least 1 performance favorite realmresults<festivalentity> results = realm.where(festivalentity.class).any("performances.favorite", true).findall();  

actually, think use-case following query :

realmresults<festivalentity> results = realm.where(festivalentity.class)      .equalto("performances.favorite", true)      .findall();  

please check if i'm right though, link queries confuse me.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -