private void verifyMapping(Connection c, MetaClass mc, DatabaseDriver dd, ObjectMapping mapping) {
if ( mapping == null ) return;
if (!( mapping instanceof ObjectMappingDB )) {
throw new MetaException( "Expected an ObjectMappingDB instance, not a [" + mapping.getClass().getSimpleName() + "]" );
}
ObjectMappingDB omdb = (ObjectMappingDB) mapping;
try {
if ( validateDefinition( c, dd, omdb.getDBDef() )) {
createdDefs.add( omdb.getDBDef() );
}
}
catch( Exception e ) {
throw new MetaException( "Error validating mapping [" + mapping + "] for MetaClass [" + mc + "]: " + e.getMessage(), e );
}
}