@@ -0,0 +1,3009 @@
+package liquibase.sqlgenerator.core;%0A%0Aimport liquibase.database.Database;%0Aimport liquibase.datatype.DataTypeFactory;%0Aimport liquibase.exception.ValidationErrors;%0Aimport liquibase.sql.Sql;%0Aimport liquibase.sql.UnparsedSql;%0Aimport liquibase.sqlgenerator.SqlGeneratorChain;%0Aimport liquibase.sqlgenerator.core.InsertGenerator;%0Aimport liquibase.statement.DatabaseFunction;%0Aimport liquibase.statement.core.InsertStatement;%0Aimport liquibase.statement.core.InsertSetStatement;%0Aimport liquibase.structure.core.Relation;%0Aimport liquibase.structure.core.Table;%0A%0Aimport java.util.Date;%0A%0Apublic class InsertSetGenerator extends AbstractSqlGenerator%3CInsertSetStatement%3E %7B%0A%0A    @Override%0A    public ValidationErrors validate(InsertSetStatement insertStatementSet, Database database, SqlGeneratorChain sqlGeneratorChain) %7B%0A        ValidationErrors validationErrors = new ValidationErrors();%0A        validationErrors.checkRequiredField(%22tableName%22, insertStatementSet.peek().getTableName());%0A        validationErrors.checkRequiredField(%22columns%22, insertStatementSet.peek().getColumnValues());%0A%0A//      it is an error if any of the individual statements have a different table,schema, or catalog.%0A%0A//        if (insertStatement.getSchemaName() != null && !database.supportsSchemas()) %7B%0A//           validationErrors.addError(%22Database does not support schemas%22);%0A//       %7D%0A%0A        return validationErrors;%0A    %7D%0A%0A    @Override%0A    public Sql%5B%5D generateSql(InsertSetStatement statement, Database database, SqlGeneratorChain sqlGeneratorChain) %7B%0A       %0A    %09if(statement.peek() == null) %7B%0A    %09%09return new UnparsedSql%5B0%5D;%0A    %09%7D%0A        StringBuffer sql = new StringBuffer();%0A        %0A        generateHeader(sql,statement,database);%0A        generateValues(sql,statement,database);%0A%0A        return new Sql%5B%5D %7B%0A                new UnparsedSql(sql.toString(), getAffectedTable(statement))%0A        %7D;%0A    %7D%0A    %0A    public void generateHeader(StringBuffer sql,InsertSetStatement statement, Database database) %7B%0A        InsertStatement insert=statement.peek();%0A        myGenerator.generateHeader(sql,insert,database);%0A    %7D%0A    %0A    public void generateValues(StringBuffer sql,InsertSetStatement statements, Database database) %7B%0A        int index = 0;%0A        for( InsertStatement statement : statements.getStatements()) %7B%0A          index++;%0A          if(index%3Estatements.getBatchThreshold()) %7B%0A            sql.deleteCharAt(sql.lastIndexOf(%22,%22));%0A            sql.append(%22;%5Cn%22);            %0A            generateHeader(sql,statements,database);%0A            index=0;%0A          %7D%0A          myGenerator.generateValues(sql,statement,database);%0A          sql.append(%22,%22);%0A        %7D%0A        sql.deleteCharAt(sql.lastIndexOf(%22,%22));%0A        sql.append(%22;%22);%0A    %7D%0A%0A    protected Relation getAffectedTable(InsertSetStatement statement) %7B%0A        return new Table().setName(statement.getTableName()).setSchema(statement.getCatalogName(), statement.getSchemaName());%0A    %7D%0A    %0A    private InsertGenerator myGenerator= new InsertGenerator();%0A%7D%0A

Create InsertSetGenerator So that a batch of insert statements can be handled without requiring N row level transactions for a N row insert.