Question

I have a schedule entity which is in 1:n relation with a broadcast entity.

When I do somewhat like mBroadcasts = schedules.get(0).getBroadcastList(); it sorts data by id. I need to sort data by date field of the broadcast entity.

Thanks.

Was it helpful?

Solution

You can use a QueryBulder for create a select. For example, if you want to order by property date:

daoSession.getBroadcastDao().queryBuilder().orderAsc(Properties.Date);

If you need to create a complex condition WHERE...

QueryBuilder<Broadcast> qb = daoSession.getBroadcastDao().queryBuilder();

and then, add and, or, equal, lt, gt, ... or whatever you need.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top