public static void migrate(DatabaseProvider provider, SchemaConfiguration schemaConfiguration, NameConverters nameConverters, final boolean executeDestructiveUpdates, Class<? extends RawEntity<?>>... classes) throws SQLException { final Iterable<Iterable<SQLAction>> actionGroups = generateImpl(provider, schemaConfiguration, nameConverters, executeDestructiveUpdates, classes); final Connection conn = provider.getConnection(); try { final Statement stmt = conn.createStatement(); try { Set<String> completedStatements = new HashSet<String>(); for (Iterable<SQLAction> actionGroup : actionGroups) { addAll(completedStatements, provider.executeUpdatesForActions(stmt, actionGroup, completedStatements)); } } finally { stmt.close(); } } finally { conn.close(); } }
public static void migrate(DatabaseProvider provider, SchemaConfiguration schemaConfiguration, NameConverters nameConverters, final boolean executeDestructiveUpdates, Class<? extends RawEntity<?>>... classes) throws SQLException { final Iterable<Iterable<SQLAction>> actionGroups = generateImpl(provider, schemaConfiguration, nameConverters, executeDestructiveUpdates, classes); final Connection conn = provider.getConnection(); try { final Statement stmt = conn.createStatement(); try { Set<String> completedStatements = new HashSet<String>(); for (Iterable<SQLAction> actionGroup : actionGroups) { addAll(completedStatements, provider.executeUpdatesForActions(stmt, actionGroup, completedStatements)); } } finally { stmt.close(); } } finally { conn.close(); } }