MetaDataRepository repos = conf.newMetaDataRepositoryInstance();
// Force entity resolution
repos.getMetaData(BaseTestEntity1.class, null, true);
XMLPersistenceMappingSerializer ser =
new XMLPersistenceMappingSerializer((JDBCConfiguration)conf);
ser.addAll(repos);
ByteArrayOutputStream out = new ByteArrayOutputStream();
ser.serialize(new OutputStreamWriter(out), MetaDataSerializer.PRETTY);
byte[] bytes = out.toByteArray();
XMLPersistenceMappingParser parser =
new XMLPersistenceMappingParser((JDBCConfiguration)conf);
parser.parse(new InputStreamReader