}
@SuppressWarnings("unchecked")
public List<String> getAssociatedNamesTo(String principalToName, JetspeedPrincipalType from, JetspeedPrincipalType to, String associationName, Long fromSecurityDomain, Long toSecurityDomain)
{
Criteria criteria = new Criteria();
criteria.addEqualTo("associationsFrom.associationName", associationName);
criteria.addEqualTo("associationsFrom.to.name", principalToName);
criteria.addEqualTo("type", from.getName());
criteria.addEqualTo("associationsFrom.to.type", to.getName());
criteria.addEqualTo("associationsFrom.to.domainId", toSecurityDomain);
criteria.addEqualTo("domainId", fromSecurityDomain);
ReportQueryByCriteria query = QueryFactory.newReportQuery(PersistentJetspeedPrincipal.class, criteria);
query.setAttributes(new String[]{"name"});
ArrayList<String> names = new ArrayList<String>();
for (Iterator<Object[]> iter = getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); iter.hasNext(); )
{