q.setFilter("groups.contains(:groupId)");
q.setResult("mainContactId, firstName, lastName, title, suffix, gender");
Collection<Object[]> summaries = (Collection<Object[]>)q.execute(cg.getGroupId());
for (Object[] summary : summaries) {
ContactSummaryView co = new ContactSummaryView();
co.setIdentifier(KeyFactory.keyToString((Key)summary[0]));
co.setFirstName((String)summary[1]);
co.setLastName((String)summary[2]);
co.setTitle((String)summary[3]);
co.setSuffix((String)summary[4]);
co.setGender((Gender)summary[5]);
result.add(co);
}
return result;
}