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