public void createTables(Connection connection, TableCreationMode mode, boolean createIndexes) {
        ArrayList<Type<?>> sorted = sortTypes();
        try (Statement statement = connection.createStatement()) {
            if (mode == TableCreationMode.DROP_CREATE) {
                ArrayList<Type<?>> reversed = sortTypes();
                Collections.reverse(reversed);
                executeDropStatements(statement, reversed);
            }
            for (Type<?> type : sorted) {
                String sql = tableCreateStatement(type, mode);
                statementListeners.beforeExecuteUpdate(statement, sql, null);
                statement.execute(sql);
                statementListeners.afterExecuteUpdate(statement, 0);
            }
            if (createIndexes) {
                for (Type<?> type : sorted) {
                    createIndexes(connection, mode, type);
                }
            }
        } catch (SQLException e) {
            throw new TableModificationException(e);
        }
    }
public void createTables ( Connection connection , TableCreationMode mode , boolean createIndexes ) { ArrayList < Type < ? > > sorted = sortTypes ( ) ; try ( Statement statement = connection . createStatement ( ) ) { if ( mode == TableCreationMode . DROP_CREATE ) { ArrayList < Type < ? > > reversed = sortTypes ( ) ; Collections . reverse ( reversed ) ; executeDropStatements ( statement , reversed ) ; } for ( Type < ? > type : sorted ) { String sql = tableCreateStatement ( type , mode ) ; statementListeners . beforeExecuteUpdate ( statement , sql , null ) ; statement . execute ( sql ) ; statementListeners . afterExecuteUpdate ( statement , 0 ) ; } if ( createIndexes ) { for ( Type < ? > type : sorted ) { createIndexes ( connection , mode , type ) ; } } } catch ( SQLException e ) { throw new TableModificationException ( e ) ; } }
Create the tables over the connection.

@param connection to use
@param mode creation mode.
@param createIndexes true to also create indexes, false otherwise