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

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -