hasRoleDAO = new AttributeBasedRelationDAO();
hasRoleDAO.setRelationAttribute("uniqueMember");
// use attribute on target entity (of "role" type); user IDs are stored
// in a multi-valued attribute on roles.
hasRoleDAO.setUseFromEntityAttribute(false);
hasRoleDAO.setRelationType(new SecurityEntityRelationTypeImpl("hasRole","user","role"));
hasRoleDAO.setAttributeContainsInternalId(true);
relationDaos.add(hasRoleDAO);
entityManager = new DefaultLDAPEntityManager(daos, relationDaos);
}