I am currently using greenDAO as an ORM for my Android app. I encountered a problem while trying to execute a GROUPBY clause. GreenDAO has no API / helper methods to execute groupby clauses, so I decided to use the query() or queryRaw() methods available for the AbstractDAO class, where I can pass a valid SQL query. BUT, both of these methods return java.util.List, so what confuses me is that how can I get the column alias values as a result? For instance,
SELECT COUNT(ID) AS NUMOFRECORDS, NAME FROM PERSONS GROUP BY AGE
My object will have the NAME and AGE fields, but I created an alias for the NUMOFRECORDS column, which is not part of Entity.
Appreciate your help!
source share