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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

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

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