liquibase.statement.core.InsertSetStatement Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of liquibase-core Show documentation
Show all versions of liquibase-core Show documentation
Liquibase is a tool for managing and executing database changes.
package liquibase.statement.core;
import liquibase.statement.AbstractSqlStatement;
import java.util.LinkedList;
import java.util.List;
public class InsertSetStatement extends AbstractSqlStatement {
private final LinkedList inserts = new LinkedList<>();
private final String catalogName;
private final String schemaName;
private final String tableName;
private final int batchSize;
public InsertSetStatement(String catalogName, String schemaName, String tableName) {
this(catalogName, schemaName, tableName, 50);
}
public InsertSetStatement(String catalogName, String schemaName, String tableName,int batchSize) {
this.catalogName = catalogName;
this.schemaName = schemaName;
this.tableName = tableName;
this.batchSize = batchSize;
}
public String getCatalogName() {
return catalogName;
}
public String getSchemaName() {
return schemaName;
}
public String getTableName() {
return tableName;
}
public int getBatchThreshold() {
return batchSize;
}
public InsertSetStatement addInsertStatement(InsertStatement statement) {
inserts.add(statement);
return this;
}
public InsertStatement peek() {
return inserts.peek();
}
public List getStatements() {
return inserts;
}
public InsertStatement[] getStatementsArray() {
return inserts.toArray(new InsertStatement[0]);
}
}