return getSingleResult(query.getResultList());
}
@Override
public List<Person> findAllConnectedPeople(String username) {
Person person = findByUsername(username);
List<Person> connections = Lists.newLinkedList();
if (person != null) {
String personId = person.getId();
connections.addAll(findFriends(username));
TypedQuery<JpaGroup> members = manager.createQuery("SELECT g from JpaGroup g where :userId member of g.members", JpaGroup.class);
members.setParameter("userId", personId);
for (JpaGroup groups : members.getResultList()) {
addPeopleByIds(groups, connections);