// Initialize a new SqlResultSetMapping (with the metadata name)
oracle.toplink.essentials.queryframework.SQLResultSetMapping mapping = new oracle.toplink.essentials.queryframework.SQLResultSetMapping(sqlResultSetMapping.getName());
// Process the entity results.
for (MetadataEntityResult eResult : sqlResultSetMapping.getEntityResults()) {
EntityResult entityResult = new EntityResult(eResult.getEntityClass().getName());
// Process the field results.
for (MetadataFieldResult fResult : eResult.getFieldResults()) {
entityResult.addFieldResult(new FieldResult(fResult.getName(), fResult.getColumn()));
}
// Process the discriminator value;
entityResult.setDiscriminatorColumn(eResult.getDiscriminatorColumn());
// Add the result to the SqlResultSetMapping.
mapping.addResult(entityResult);
}