How to load all fields from a database and sort the result after one row using GreenDao?

I want to load all entities from sqlite database with greendao and sort the result.

I can load all loadAll objects , but this does not give me a guarantee regarding the sorting of the resulting list.

+4
source share
1 answer

Use queryBiulderas below:

List joes = userDao.queryBuilder().where(Properties.FirstName.eq("Joe")).orderAsc(Properties.LastName).list();

for all lines:

List joes = userDao.queryBuilder().orderAsc(Properties.LastName).list();

Source

+10
source

Source: https://habr.com/ru/post/1569281/


All Articles