将Sql查询转换为Realm Query

时间:2016-10-06 05:16:34

标签: java android mysql sql-server realm

我正在使用Realm(版本0.87)。我想转换sql查询

Select * from Users where 'firstname' + " "+ 'lastname' like "Ranjana Dangol".

我试过它

RealmQuery<UserEntityData> query =  realm.where(UserEntityData.class).beginGroup();
String searchQuery = "Ranjana Dangol"
String[] queries = searchQuery.split("\\s+");

for(String username : queries){
 query.equalTo(UserEntityData.FIRST_NAME, username, Case.INSENSITIVE)
 .equalTo(UserEntityData.LAST_NAME, username, Case.INSENSITIVE);
}

0 个答案:

没有答案