+ " where item.loggedBy.id = ? and item.space.id = ? group by item.status", new Object[] {user.getId(), space.getId()});
List<Object[]> assignedToList = ht.find("select status, count(item) from Item item"
+ " where item.assignedTo.id = ? and item.space.id = ? group by item.status", new Object[] {user.getId(), space.getId()});
List<Object[]> statusList = ht.find("select status, count(item) from Item item"
+ " where item.space.id = ? group by item.status", space.getId());
Counts c = new Counts(true);
for(Object[] oa : loggedByList) {
c.addLoggedByMe((Integer) oa[0], (Long) oa[1]);
}
for(Object[] oa : assignedToList) {
c.addAssignedToMe((Integer) oa[0], (Long) oa[1]);
}
for(Object[] oa : statusList) {
c.addTotal((Integer) oa[0], (Long) oa[1]);
}
return c;
}