Package liquibase.changelog
Class ChangeSet
java.lang.Object
liquibase.changelog.ChangeSet
- All Implemented Interfaces:
- ChangeLogChild,- Conditional,- LiquibaseSerializable
Encapsulates a changeSet and all its associated changes.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumNested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializableLiquibaseSerializable.SerializationType
- 
Field SummaryFieldsFields inherited from interface liquibase.serializer.LiquibaseSerializableGENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
- 
Constructor SummaryConstructorsConstructorDescriptionChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, boolean runInTransaction, DatabaseChangeLog databaseChangeLog) ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, boolean runInTransaction, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, String runWith, String runWithSpoolFile, boolean runInTransaction, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, DatabaseChangeLog databaseChangeLog) ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) ChangeSet(DatabaseChangeLog databaseChangeLog) 
- 
Method SummaryModifier and TypeMethodDescriptionvoidvoidvoidaddRollbackChange(Change change) voidaddRollBackSQL(String sql) voidaddSqlVisitor(SqlVisitor sqlVisitor) voidaddValidCheckSum(String text) Build and return a string which contains both the changeset and inherited contextBuild and return a string which contains both the changeset and inherited labelsvoidbooleanexecute(DatabaseChangeLog databaseChangeLog, ChangeExecListener listener, Database database) This method will actually execute each of the changes in the list against the specified database.execute(DatabaseChangeLog databaseChangeLog, Database database) generateCheckSum(ChecksumVersion version) getAttribute(String attribute) Returns an unmodifiable list of changes.Deprecated.longgetId()Returns the logical file path defined directly on this node.getSerializableFieldType(String field) getSerializableFieldValue(String field) Gets storedCheckSumprotected voidhandleChildNode(ParsedNode child, ResourceAccessor resourceAccessor) protected voidhandleRollbackNode(ParsedNode rollbackNode, ResourceAccessor resourceAccessor) booleanReturns whether custom rollback steps are specified for this changeSet, or whether auto-generated ones should be usedinthashCode()booleanbooleanisCheckSumValid(CheckSum storedCheckSum) booleanisIgnore()booleanbooleanbooleanvoidload(ParsedNode node, ResourceAccessor resourceAccessor) static StringlookupExecutor(String executorName) Look for a configuration property that matches liquibase..executor and if found, return its value as the executor name voidremoveAllChanges(Collection<?> collection) Method created to remove changes from a changesetvoidvoidrollback(Database database, ChangeExecListener listener) setAttribute(String attribute, Object value) voidsetChangeLogParameters(ChangeLogParameters changeLogParameters) Called by the changelog parsing process to pass theChangeLogParameters.voidsetComments(String comments) setContextFilter(ContextExpression contextFilter) setContexts(ContextExpression contexts) Deprecated.protected voidvoidsetDeploymentId(String deploymentId) voidsetFailOnError(Boolean failOnError) voidsetFilePath(String filePath) Called to update file path from database entry when rolling back and ignoreClasspathPrefix is true.voidsetIgnore(boolean ignore) voidvoidsetLogicalFilePath(String logicalFilePath) voidsetOnValidationFail(ChangeSet.ValidationFailOption onValidationFail) voidsetPreconditions(PreconditionContainer preconditionContainer) voidsetRunOrder(String runOrder) voidsetRunWith(String runWith) voidsetRunWithSpoolFile(String runWithSpoolFile) voidsetStoredCheckSum(CheckSum storedCheckSum) Sets the stored checksum in the ValidatingVisitor in case the changeset was executed.voidsetStoredFilePath(String storedFilePath) voidsetValidationFailed(boolean validationFailed) booleanbooleanbooleansupportsRollback(Database database) protected ChangetoChange(ParsedNode value, ResourceAccessor resourceAccessor) toString()toString(boolean includeMD5Sum) 
- 
Field Details- 
CHANGE_KEY- See Also:
 
- 
checkSum
- 
key
 
- 
- 
Constructor Details- 
ChangeSet
- 
ChangeSet
- 
ChangeSet
- 
ChangeSetpublic ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) 
- 
ChangeSetpublic ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, boolean runInTransaction, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) 
- 
ChangeSetpublic ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextFilter, String dbmsList, String runWith, String runWithSpoolFile, boolean runInTransaction, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog) 
 
- 
- 
Method Details- 
shouldAlwaysRunpublic boolean shouldAlwaysRun()
- 
shouldRunOnChangepublic boolean shouldRunOnChange()
- 
setDbms
- 
getFilePath- Returns:
- either this object's logicalFilePath or the changelog's filepath (logical or physical) if not.
 
- 
getLogicalFilePathReturns the logical file path defined directly on this node. Returnsnullif not set.- Returns:
- the logical file path defined on this node, or nullif not set
 
- 
setLogicalFilePath
- 
getStoredFilePath
- 
setStoredFilePath
- 
getRunWith- Returns:
- the runWith value. If the runWith value is empty or not set this method will return null.
 
- 
setRunWith
- 
getRunWithSpoolFile
- 
setRunWithSpoolFile
- 
clearCheckSumpublic void clearCheckSum()
- 
generateCheckSum
- 
load- Specified by:
- loadin interface- LiquibaseSerializable
- Throws:
- ParsedNodeException
 
- 
handleChildNodeprotected void handleChildNode(ParsedNode child, ResourceAccessor resourceAccessor) throws ParsedNodeException - Throws:
- ParsedNodeException
 
- 
handleRollbackNodeprotected void handleRollbackNode(ParsedNode rollbackNode, ResourceAccessor resourceAccessor) throws ParsedNodeException - Throws:
- ParsedNodeException
 
- 
toChangeprotected Change toChange(ParsedNode value, ResourceAccessor resourceAccessor) throws ParsedNodeException - Throws:
- ParsedNodeException
 
- 
serialize- Specified by:
- serializein interface- LiquibaseSerializable
 
- 
executepublic ChangeSet.ExecType execute(DatabaseChangeLog databaseChangeLog, Database database) throws MigrationFailedException - Throws:
- MigrationFailedException
 
- 
executepublic ChangeSet.ExecType execute(DatabaseChangeLog databaseChangeLog, ChangeExecListener listener, Database database) throws MigrationFailedException This method will actually execute each of the changes in the list against the specified database.- Returns:
- should changeset be marked as ran
- Throws:
- MigrationFailedException
 
- 
lookupExecutorLook for a configuration property that matches liquibase..executor and if found, return its value as the executor name - Parameters:
- executorName- The value from the input changeset runWith attribute
- Returns:
- String The mapped value
 
- 
rollback- Throws:
- RollbackFailedException
 
- 
rollback- Throws:
- RollbackFailedException
 
- 
hasCustomRollbackChangespublic boolean hasCustomRollbackChanges()Returns whether custom rollback steps are specified for this changeSet, or whether auto-generated ones should be used
- 
getChangesReturns an unmodifiable list of changes. To add one, use the addRefactoring method.
- 
removeAllChangesMethod created to remove changes from a changeset- Parameters:
- collection-
 
- 
addChange
- 
getId
- 
getAuthor
- 
getContextsDeprecated.
- 
setContextsDeprecated.
- 
getContextFilter
- 
setContextFilter
- 
getLabels
- 
setLabels
- 
getDbmsSet
- 
isIgnorepublic boolean isIgnore()
- 
setIgnorepublic void setIgnore(boolean ignore) 
- 
isInheritableIgnorepublic boolean isInheritableIgnore()
- 
getInheritableContextFilter
- 
getInheritableLabels
- 
buildFullContextBuild and return a string which contains both the changeset and inherited context- Returns:
- String
 
- 
buildFullLabelsBuild and return a string which contains both the changeset and inherited labels- Returns:
- String
 
- 
getChangeLog
- 
toString
- 
toNormalizedString
- 
toString
- 
getComments
- 
setComments
- 
isAlwaysRunpublic boolean isAlwaysRun()
- 
isRunOnChangepublic boolean isRunOnChange()
- 
isRunInTransactionpublic boolean isRunInTransaction()
- 
getRollback
- 
addRollBackSQL
- 
addRollbackChange
- 
supportsRollback
- 
getDescription
- 
getFailOnError
- 
setFailOnError
- 
getOnValidationFail
- 
setOnValidationFail
- 
setValidationFailedpublic void setValidationFailed(boolean validationFailed) 
- 
addValidCheckSum
- 
getValidCheckSums
- 
isCheckSumValid
- 
getPreconditions- Specified by:
- getPreconditionsin interface- Conditional
 
- 
setPreconditions- Specified by:
- setPreconditionsin interface- Conditional
 
- 
addSqlVisitor
- 
getSqlVisitors
- 
getChangeLogParameters
- 
setChangeLogParametersCalled by the changelog parsing process to pass theChangeLogParameters.
- 
setFilePathCalled to update file path from database entry when rolling back and ignoreClasspathPrefix is true.
- 
setRunOrder
- 
getSerializedObjectName- Specified by:
- getSerializedObjectNamein interface- LiquibaseSerializable
 
- 
getSerializableFields- Specified by:
- getSerializableFieldsin interface- LiquibaseSerializable
 
- 
getSerializableFieldValue- Specified by:
- getSerializableFieldValuein interface- LiquibaseSerializable
 
- 
getSerializableFieldType- Specified by:
- getSerializableFieldTypein interface- LiquibaseSerializable
 
- 
getSerializedObjectNamespace- Specified by:
- getSerializedObjectNamespacein interface- LiquibaseSerializable
 
- 
getSerializableFieldNamespace- Specified by:
- getSerializableFieldNamespacein interface- LiquibaseSerializable
 
- 
equals
- 
hashCodepublic int hashCode()
- 
getAttribute
- 
setAttribute
- 
getStoredCheckSumGets storedCheckSum- Returns:
- storedCheckSum if it was executed otherwise null
 
- 
setStoredCheckSumSets the stored checksum in the ValidatingVisitor in case the changeset was executed.- Parameters:
- storedCheckSum- the checksum to set
 
- 
getDeploymentId- Returns:
- Deployment ID stored in the databasechangelog table.
 
- 
setDeploymentId- Parameters:
- deploymentId- Deployment ID stored in the databasechangelog table.
 
- 
addChangeSetMdcPropertiespublic void addChangeSetMdcProperties()
- 
getExecutionMillisecondspublic long getExecutionMilliseconds()
 
- 
getContextFilter()