if (importFile != null) {
cfg.setProperty( Environment.HBM2DDL_IMPORT_FILES, importFile );
}
BasicServiceRegistryImpl serviceRegistry = createServiceRegistry( cfg.getProperties() );
try {
SchemaExport se = new SchemaExport( serviceRegistry, cfg )
.setHaltOnError( halt )
.setOutputFile( outFile )
.setDelimiter( delim );
if ( format ) {
se.setFormat( true );
}
se.execute( script, export, drop, create );
}
finally {
serviceRegistry.destroy();
}
}
catch ( Exception e ) {
LOG.unableToCreateSchema(e);
e.printStackTrace();