Package liquibase.change.core
Class LoadUpdateDataChange
- java.lang.Object
-
- liquibase.AbstractExtensibleObject
-
- liquibase.plugin.AbstractPlugin
-
- liquibase.change.AbstractChange
-
- liquibase.change.AbstractTableChange
-
- liquibase.change.core.LoadDataChange
-
- liquibase.change.core.LoadUpdateDataChange
-
- All Implemented Interfaces:
Cloneable
,Change
,ChangeWithColumns<LoadDataColumnConfig>
,ExtensibleObject
,Plugin
,LiquibaseSerializable
public class LoadUpdateDataChange extends LoadDataChange
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class liquibase.change.core.LoadDataChange
LoadDataChange.LOAD_DATA_TYPE, LoadDataChange.LoadDataRowConfig
-
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
-
-
Field Summary
-
Fields inherited from class liquibase.change.core.LoadDataChange
BASE64_PATTERN, DEFAULT_COMMENT_PATTERN
-
Fields inherited from class liquibase.change.AbstractTableChange
catalogName, schemaName, tableName
-
Fields inherited from class liquibase.change.AbstractChange
NODENAME_COLUMN
-
Fields inherited from interface liquibase.change.Change
EMPTY_CHANGE, SHOULD_EXECUTE
-
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description LoadUpdateDataChange()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ChangeStatus
checkStatus(Database database)
Validate that this change executed successfully against the given database.protected ExecutablePreparedStatementBase
createPreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor)
protected InsertStatement
createStatement(String catalogName, String schemaName, String tableName)
Creates aInsertOrUpdateStatement
statement object for the specified tableSqlStatement[]
generateRollbackStatements(Database database)
Implementation relies on value returned fromAbstractChange.createInverses()
.Boolean
getOnlyUpdate()
String
getPrimaryKey()
String
getSerializedObjectNamespace()
String
getTableName()
protected boolean
hasPreparedStatementsImplemented()
void
setOnlyUpdate(Boolean onlyUpdate)
void
setPrimaryKey(String primaryKey)
-
Methods inherited from class liquibase.change.core.LoadDataChange
addColumn, columnConfigFromName, columnIdString, createStatementSet, generateCheckSum, generateRollbackStatementsVolatile, generateStatements, generateStatementsFromRows, generateStatementsVolatile, getColumnConfig, getColumns, getCommentLineStartsWith, getConfirmationMessage, getCSVReader, getEncoding, getFile, getQuotchar, getRelativeTo, getSeparator, getUsePreparedStatements, getValueToWrite, isRelativeToChangelogFile, setColumns, setCommentLineStartsWith, setEncoding, setFile, setQuotchar, setRelativeToChangelogFile, setSeparator, setUsePreparedStatements, supports, supportsBatchUpdates, validate, validateColumn, validateColumns, warn
-
Methods inherited from class liquibase.change.AbstractTableChange
getCatalogName, getSchemaName, setCatalogName, setSchemaName, setTableName
-
Methods inherited from class liquibase.change.AbstractChange
createAlternateParameterNames, createChangeMetaData, createChangeParameterMetadata, createDescriptionMetaData, createEmptyColumnConfig, createExampleValueMetaData, createInverses, createMustEqualExistingMetaData, createRequiredDatabasesMetaData, createSerializationTypeMetaData, createSinceMetaData, createSupportedDatabasesMetaData, customLoadLogic, equals, finishInitialization, getAffectedDatabaseObjects, getChangeSet, getDescription, getExcludedFieldFilters, getResourceAccessor, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldType, getSerializableFieldValue, getSerializedObjectName, hashCode, isInvalidProperty, load, modify, serialize, serializeValue, setChangeSet, setResourceAccessor, shouldExecuteChange, supportsRollback, toString
-
Methods inherited from class liquibase.AbstractExtensibleObject
clone, describe, get, get, get, getAttributes, getFieldValue, getObjectMetaData, getValuePath, has, set
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface liquibase.ExtensibleObject
clone, describe, get, get, getAttributes, getObjectMetaData, getValuePath, has, set
-
-
-
-
Method Detail
-
hasPreparedStatementsImplemented
protected boolean hasPreparedStatementsImplemented()
- Overrides:
hasPreparedStatementsImplemented
in classLoadDataChange
-
getTableName
public String getTableName()
- Overrides:
getTableName
in classLoadDataChange
-
setPrimaryKey
public void setPrimaryKey(String primaryKey)
-
getPrimaryKey
public String getPrimaryKey()
-
getOnlyUpdate
public Boolean getOnlyUpdate()
-
setOnlyUpdate
public void setOnlyUpdate(Boolean onlyUpdate)
-
createStatement
protected InsertStatement createStatement(String catalogName, String schemaName, String tableName)
Creates aInsertOrUpdateStatement
statement object for the specified table- Overrides:
createStatement
in classLoadDataChange
- Parameters:
catalogName
- name of the catalog where the table existsschemaName
- name of the schema where the table existstableName
- the table name to insert/update data- Returns:
- a specialised
InsertOrUpdateStatement
that will either insert or update rows in the target table
-
createPreparedStatement
protected ExecutablePreparedStatementBase createPreparedStatement(Database database, String catalogName, String schemaName, String tableName, List<LoadDataColumnConfig> columns, ChangeSet changeSet, ResourceAccessor resourceAccessor)
- Overrides:
createPreparedStatement
in classLoadDataChange
-
generateRollbackStatements
public SqlStatement[] generateRollbackStatements(Database database) throws RollbackImpossibleException
Description copied from class:AbstractChange
Implementation relies on value returned fromAbstractChange.createInverses()
.- Specified by:
generateRollbackStatements
in interfaceChange
- Overrides:
generateRollbackStatements
in classAbstractChange
- Throws:
RollbackImpossibleException
- if rollback is not supported for this change
-
getSerializedObjectNamespace
public String getSerializedObjectNamespace()
- Specified by:
getSerializedObjectNamespace
in interfaceLiquibaseSerializable
- Overrides:
getSerializedObjectNamespace
in classLoadDataChange
-
checkStatus
public ChangeStatus checkStatus(Database database)
Description copied from interface:Change
Validate that this change executed successfully against the given database. This will check that the update completed at a high level plus check details of the change. For example, a change to add a column will check that the column exists plus data type, default values, etc.- Specified by:
checkStatus
in interfaceChange
- Overrides:
checkStatus
in classLoadDataChange
-
-