I have found few questions related to this issue in SO, but did not help me much.I want to construct a query in Android using GreenDao library, query should grab all the rows containing particular phonenumber in descending order of datetime and I also want to group them by group name.
List<activity> activities = activityDao.queryBuilder().where(Properties.Contact_number.eq(phonenumber)).orderDesc(Properties.Date_time).build().list();
GROUP BY is not supported by GreenDao.
You can use this trick :
where(new WhereCondition.StringCondition(Properties.Contact_number.eq(phonenumber) + "GROUP BY group_name")).orderDesc(Properties.Date_time).build().list();
It let you build your where clause using String.