liquibase.statement.core.InsertStatement 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.change.ColumnConfig;
import liquibase.statement.AbstractSqlStatement;
import java.util.LinkedHashMap;
import java.util.Map;
public class InsertStatement extends AbstractSqlStatement {
private final String catalogName;
private final String schemaName;
private final String tableName;
private final Map columnValues = new LinkedHashMap<>();
public InsertStatement(String catalogName, String schemaName, String tableName) {
this.catalogName = catalogName;
this.schemaName = schemaName;
this.tableName = tableName;
}
public String getCatalogName() {
return catalogName;
}
public String getSchemaName() {
return schemaName;
}
public String getTableName() {
return tableName;
}
public InsertStatement addColumnValue(String columnName, Object newValue) {
columnValues.put(columnName, newValue);
return this;
}
public Object getColumnValue(String columnName) {
return columnValues.get(columnName);
}
public Map getColumnValues() {
return columnValues;
}
public InsertStatement addColumn(ColumnConfig columnConfig) {
return addColumnValue(columnConfig.getName(), columnConfig.getValueObject());
}
}