Printing a Realm Query

孤者浪人 提交于 2019-12-23 12:46:28

问题


I am migrating my existing project's database from SQLite to Realm. So there is a way to print Query like we can get/print in SQLite.

SQL Query:

select * from Patient where "revision=8" and (long_description like="%bone%" or code like="%bone%") order by code

My Realm Query:

realm.where(Patient.class)
     .equalTo("revision", "8")
     .and()
     .beginGroup()
         .like("long_description", "*bone*").or()
         .like("code", "*bone*")
     .endGroup()
     .sort("code");

来源:https://stackoverflow.com/questions/49936344/printing-a-realm-query

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!