Collection<EntityRelationDAO> relationDaos = new ArrayList<EntityRelationDAO>();
// hasRole relation DAO
// use attribute on from entity (of "user" type); user IDs are stored
// in the "j2-role" attribute
hasRoleDAO = new AttributeBasedRelationDAO();
hasRoleDAO.setRelationAttribute("uniqueMember");
hasRoleDAO.setUseFromEntityAttribute(false);
hasRoleDAO.setRelationType(new SecurityEntityRelationTypeImpl("hasRole","user","role"));
hasRoleDAO.setAttributeContainsInternalId(true);
relationDaos.add(hasRoleDAO);