How to search on multiple columns at same time using GreenDao?

302 Views Asked by At

suppose I have two columns Name and Surname. There is one row with Greame in Name column and Latham in Surname. I want that row to be fetched when query key is Greame Latham.

How to achieve that using Greendao QueryBuilder?

Thanks.

1

There are 1 best solutions below

2
On

Following code will help you to fetch data on the basis of two params:

if(childDao().queryBuilder()
             .where(ChildeDao.Properties.Name.like("%" + f_name+ "%"), 
                    ChildDao.Properties.Surname.like("%" +l_name+ "%"))
             .list().size() == 0){
//fetch from db
}