java - Realm select by property of property -


i have 2 realmmodels

class shop{      private string name;     private item item;  }  class item{     private int itemid;     private string itemname; } 

i want find shop has item itemid = 1.

any ideas?

you can query across references (links) in realm. below should work:

realm.where(shop.class).equalto("item.itemid", 1).findfirst() 

Comments

Popular posts from this blog

php - Using str_replace to translate a MySQL Table in html -

asp.net mvc - Cannot display error message on Editor or EditorFor -

SQL Server - MyCTE query based on 24 hour period (next day) -