query.append("and suggested not in (:links) ");
}
query.append("group by suggested ")
.append("order by nbShared desc");
JPAQuery jpaQuery = Member.find(query.toString())
.bind("member", member)
.bind("interests", member.interests);
if (!member.links.isEmpty()) {
jpaQuery.bind("links", member.links);
}
List<Object[]> result = jpaQuery.fetch(limit);
suggestions = Lists.transform(result, MEMBER_SUGGESTIONS_FUNCTION);
}
return suggestions;
}