final InMemoryMetadataDomainRepository repo = new InMemoryMetadataDomainRepository();
final XmiParser parser = new XmiParser();
final Domain domain = parser.parseXmi(stream);
// add a couple of agg types to the quantity ordered physical column
final IPhysicalTable table = ((SqlPhysicalModel) domain.getPhysicalModels().get(0)).getPhysicalTables().get(7);
final IPhysicalColumn col = table.getPhysicalColumns().get(3);
final List<AggregationType> list = new ArrayList<AggregationType>();
list.add(AggregationType.SUM);
list.add(AggregationType.AVERAGE);
col.setAggregationList(list);
domain.setId(domainId);
repo.storeDomain(domain, true);
return repo;
}
finally