Connection c = (Connection) oc.getDatastoreConnection();
// This will hold any tables that were created
createdDefs = new ArrayList<BaseDef>();
MappingHandler mh = getObjectManager().getMappingHandler();
DatabaseDriver dd = getObjectManager().getDatabaseDriver();
// Validate all Writeable (TABLE) MetaClasses
for( MetaClassLoader loader : MetaClassLoader.getClassLoaders() )
{
// Verify the Mutable Mappings
for( MetaClass mc : loader.getMetaClasses() )
{
verifyMapping( c, mc, dd, mh.getCreateMapping( mc ));
verifyMapping( c, mc, dd, mh.getUpdateMapping( mc ));
verifyMapping( c, mc, dd, mh.getDeleteMapping( mc ));
}
// Verify the Read-only Mappings (This could be views)
for( MetaClass mc : loader.getMetaClasses() )
{
verifyMapping( c, mc, dd, mh.getReadMapping( mc ));
}
}
// Create foreign keys for newly created tables
for( BaseDef def : createdDefs )