public static void schemaExportPerform ( String [ ] sqlCommands , List exporters , SchemaExport schemaExport ) { if ( schemaExportPerform == null ) { try { schemaExportPerform = SchemaExport . class . getMethod ( "performApi" , String [ ] . class , List . class , String . class ) ; } catch ( NoSuchMethodException e ) { LOG . error ( "cannot find api method inserted by patch" , e ) ; } } String [ ] wrapArr = new String [ 1 ] ; for ( String sqlCommand : sqlCommands ) { for ( String singleSql : splitSQL ( sqlCommand ) ) { SqlStatement ddlStmt = prepareDDL ( singleSql ) ; wrapArr [ 0 ] = ddlStmt . getSql ( ) ; boolean emptyStatement = isEmptyStatement ( singleSql ) ; try { List passedExporters = new ArrayList ( ) ; passedExporters . add ( null ) ; for ( Object exporter : exporters ) { passedExporters . set ( 0 , exporter ) ; boolean databaseExporter = exporter . getClass ( ) . getSimpleName ( ) . equals ( "DatabaseExporter" ) ; if ( ! databaseExporter || ! emptyStatement ) { schemaExportPerform . invoke ( schemaExport , new Object [ ] { wrapArr , passedExporters , databaseExporter ? null : ddlStmt . getDelimiter ( ) } ) ; } } } catch ( InvocationTargetException e ) { if ( e . getCause ( ) instanceof SQLException && ! emptyStatement ) { LOG . warn ( "failed executing sql: {}" , singleSql ) ; LOG . warn ( "failure: {}" , e . getCause ( ) . getMessage ( ) ) ; } } catch ( Exception e ) { LOG . error ( "cannot call patched api method in SchemaExport" , e ) ; } } } }
Hibernate 4 . 3 . 5