-
Couldn't load subscription status.
- Fork 8
Grouping data
gert-wijns edited this page Feb 6, 2014
·
3 revisions
Grouping by values can be done by using the groupBy(...) methods available on the TypeSafeQuery.
Person person = query.from(Person.class);
query.selectValue(person.getName());
query.selectValue(person.getAge());
query.groupBy(person.getName()).
and(person.getAge()); // can be chained, can also just call groupBy again too
hqlQuery.getHql() would yield =>
"select hobj1.name, hobj1.age from Person hobj1 group by hobj1.name, hobj1.age"