liquibase.changelog
Class ChangeSet

java.lang.Object
  extended by liquibase.changelog.ChangeSet
All Implemented Interfaces:
ChangeLogChild, Conditional, LiquibaseSerializable

public class ChangeSet
extends Object
implements Conditional, ChangeLogChild

Encapsulates a changeSet and all its associated changes.


Nested Class Summary
static class ChangeSet.ExecType
           
static class ChangeSet.RunStatus
           
static class ChangeSet.ValidationFailOption
           
 
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable
LiquibaseSerializable.SerializationType
 
Field Summary
protected  CheckSum checkSum
           
protected  String key
           
 
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
 
Constructor Summary
ChangeSet(DatabaseChangeLog databaseChangeLog)
           
ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, boolean runInTransaction, DatabaseChangeLog databaseChangeLog)
           
ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, boolean runInTransaction, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog)
           
ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, DatabaseChangeLog databaseChangeLog)
           
ChangeSet(String id, String author, boolean alwaysRun, boolean runOnChange, String filePath, String contextList, String dbmsList, ObjectQuotingStrategy quotingStrategy, DatabaseChangeLog databaseChangeLog)
           
 
Method Summary
 void addChange(Change change)
           
 void addRollbackChange(Change change)
           
 void addRollBackSQL(String sql)
           
 void addSqlVisitor(SqlVisitor sqlVisitor)
           
 void addValidCheckSum(String text)
           
 void clearCheckSum()
           
 boolean equals(Object obj)
           
 ChangeSet.ExecType execute(DatabaseChangeLog databaseChangeLog, ChangeExecListener listener, Database database)
          This method will actually execute each of the changes in the list against the specified database.
 ChangeSet.ExecType execute(DatabaseChangeLog databaseChangeLog, Database database)
           
 CheckSum generateCheckSum()
           
 String getAuthor()
           
 DatabaseChangeLog getChangeLog()
           
 ChangeLogParameters getChangeLogParameters()
           
 List<Change> getChanges()
          Returns an unmodifiable list of changes.
 String getComments()
           
 ContextExpression getContexts()
           
 String getCreated()
           
 Set<String> getDbmsSet()
           
 String getDescription()
           
 Boolean getFailOnError()
           
 String getFilePath()
           
 String getId()
           
 Collection<ContextExpression> getInheritableContexts()
           
 Labels getLabels()
           
 ObjectQuotingStrategy getObjectQuotingStrategy()
           
 ChangeSet.ValidationFailOption getOnValidationFail()
           
 PreconditionContainer getPreconditions()
           
 RollbackContainer getRollback()
           
 String getRunOrder()
           
 String getSerializableFieldNamespace(String field)
           
 Set<String> getSerializableFields()
           
 LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
           
 Object getSerializableFieldValue(String field)
           
 String getSerializedObjectName()
           
 String getSerializedObjectNamespace()
           
 List<SqlVisitor> getSqlVisitors()
           
 Set<CheckSum> getValidCheckSums()
           
protected  void handleChildNode(ParsedNode child, ResourceAccessor resourceAccessor)
           
protected  void handleRollbackNode(ParsedNode rollbackNode, ResourceAccessor resourceAccessor)
           
protected  boolean hasCustomRollbackChanges()
          Returns whether custom rollback steps are specified for this changeSet, or whether auto-generated ones should be used
 int hashCode()
           
 boolean isAlwaysRun()
           
 boolean isCheckSumValid(CheckSum storedCheckSum)
           
 boolean isRunInTransaction()
           
 boolean isRunOnChange()
           
 void load(ParsedNode node, ResourceAccessor resourceAccessor)
           
 void rollback(Database database)
           
 ParsedNode serialize()
           
 void setChangeLogParameters(ChangeLogParameters changeLogParameters)
          Called by the changelog parsing process to pass the ChangeLogParameters.
 void setComments(String comments)
           
 void setCreated(String created)
           
protected  void setDbms(String dbmsList)
           
 void setFailOnError(Boolean failOnError)
           
 void setFilePath(String filePath)
          Called to update file path from database entry when rolling back and ignoreClasspathPrefix is true.
 void setLabels(Labels labels)
           
 void setOnValidationFail(ChangeSet.ValidationFailOption onValidationFail)
           
 void setPreconditions(PreconditionContainer preconditionContainer)
           
 void setRunOrder(String runOrder)
           
 void setValidationFailed(boolean validationFailed)
           
 boolean shouldAlwaysRun()
           
 boolean shouldRunOnChange()
           
 boolean supportsRollback(Database database)
           
protected  Change toChange(ParsedNode value, ResourceAccessor resourceAccessor)
           
 String toString()
           
 String toString(boolean includeMD5Sum)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

checkSum

protected CheckSum checkSum

key

protected String key
Constructor Detail

ChangeSet

public ChangeSet(DatabaseChangeLog databaseChangeLog)

ChangeSet

public ChangeSet(String id,
                 String author,
                 boolean alwaysRun,
                 boolean runOnChange,
                 String filePath,
                 String contextList,
                 String dbmsList,
                 DatabaseChangeLog databaseChangeLog)

ChangeSet

public ChangeSet(String id,
                 String author,
                 boolean alwaysRun,
                 boolean runOnChange,
                 String filePath,
                 String contextList,
                 String dbmsList,
                 boolean runInTransaction,
                 DatabaseChangeLog databaseChangeLog)

ChangeSet

public ChangeSet(String id,
                 String author,
                 boolean alwaysRun,
                 boolean runOnChange,
                 String filePath,
                 String contextList,
                 String dbmsList,
                 ObjectQuotingStrategy quotingStrategy,
                 DatabaseChangeLog databaseChangeLog)

ChangeSet

public ChangeSet(String id,
                 String author,
                 boolean alwaysRun,
                 boolean runOnChange,
                 String filePath,
                 String contextList,
                 String dbmsList,
                 boolean runInTransaction,
                 ObjectQuotingStrategy quotingStrategy,
                 DatabaseChangeLog databaseChangeLog)
Method Detail

shouldAlwaysRun

public boolean shouldAlwaysRun()

shouldRunOnChange

public boolean shouldRunOnChange()

setDbms

protected void setDbms(String dbmsList)

getFilePath

public String getFilePath()

clearCheckSum

public void clearCheckSum()

generateCheckSum

public CheckSum generateCheckSum()

load

public void load(ParsedNode node,
                 ResourceAccessor resourceAccessor)
          throws ParsedNodeException
Specified by:
load in interface LiquibaseSerializable
Throws:
ParsedNodeException

handleChildNode

protected void handleChildNode(ParsedNode child,
                               ResourceAccessor resourceAccessor)
                        throws ParsedNodeException
Throws:
ParsedNodeException

handleRollbackNode

protected void handleRollbackNode(ParsedNode rollbackNode,
                                  ResourceAccessor resourceAccessor)
                           throws ParsedNodeException
Throws:
ParsedNodeException

toChange

protected Change toChange(ParsedNode value,
                          ResourceAccessor resourceAccessor)
                   throws ParsedNodeException
Throws:
ParsedNodeException

serialize

public ParsedNode serialize()
Specified by:
serialize in interface LiquibaseSerializable

execute

public ChangeSet.ExecType execute(DatabaseChangeLog databaseChangeLog,
                                  Database database)
                           throws MigrationFailedException
Throws:
MigrationFailedException

execute

public 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 change set be marked as ran
Throws:
MigrationFailedException

rollback

public void rollback(Database database)
              throws RollbackFailedException
Throws:
RollbackFailedException

hasCustomRollbackChanges

protected boolean hasCustomRollbackChanges()
Returns whether custom rollback steps are specified for this changeSet, or whether auto-generated ones should be used


getChanges

public List<Change> getChanges()
Returns an unmodifiable list of changes. To add one, use the addRefactoing method.


addChange

public void addChange(Change change)

getId

public String getId()

getAuthor

public String getAuthor()

getContexts

public ContextExpression getContexts()

getLabels

public Labels getLabels()

setLabels

public void setLabels(Labels labels)

getDbmsSet

public Set<String> getDbmsSet()

getInheritableContexts

public Collection<ContextExpression> getInheritableContexts()

getChangeLog

public DatabaseChangeLog getChangeLog()

toString

public String toString(boolean includeMD5Sum)

toString

public String toString()
Overrides:
toString in class Object

getComments

public String getComments()

setComments

public void setComments(String comments)

isAlwaysRun

public boolean isAlwaysRun()

isRunOnChange

public boolean isRunOnChange()

isRunInTransaction

public boolean isRunInTransaction()

getRollback

public RollbackContainer getRollback()

addRollBackSQL

public void addRollBackSQL(String sql)

addRollbackChange

public void addRollbackChange(Change change)

supportsRollback

public boolean supportsRollback(Database database)

getDescription

public String getDescription()

getFailOnError

public Boolean getFailOnError()

setFailOnError

public void setFailOnError(Boolean failOnError)

getOnValidationFail

public ChangeSet.ValidationFailOption getOnValidationFail()

setOnValidationFail

public void setOnValidationFail(ChangeSet.ValidationFailOption onValidationFail)

setValidationFailed

public void setValidationFailed(boolean validationFailed)

addValidCheckSum

public void addValidCheckSum(String text)

getValidCheckSums

public Set<CheckSum> getValidCheckSums()

isCheckSumValid

public boolean isCheckSumValid(CheckSum storedCheckSum)

getPreconditions

public PreconditionContainer getPreconditions()
Specified by:
getPreconditions in interface Conditional

setPreconditions

public void setPreconditions(PreconditionContainer preconditionContainer)
Specified by:
setPreconditions in interface Conditional

addSqlVisitor

public void addSqlVisitor(SqlVisitor sqlVisitor)

getSqlVisitors

public List<SqlVisitor> getSqlVisitors()

getChangeLogParameters

public ChangeLogParameters getChangeLogParameters()

setChangeLogParameters

public void setChangeLogParameters(ChangeLogParameters changeLogParameters)
Called by the changelog parsing process to pass the ChangeLogParameters.


setFilePath

public void setFilePath(String filePath)
Called to update file path from database entry when rolling back and ignoreClasspathPrefix is true.


getObjectQuotingStrategy

public ObjectQuotingStrategy getObjectQuotingStrategy()

getCreated

public String getCreated()

setCreated

public void setCreated(String created)

getRunOrder

public String getRunOrder()

setRunOrder

public void setRunOrder(String runOrder)

getSerializedObjectName

public String getSerializedObjectName()
Specified by:
getSerializedObjectName in interface LiquibaseSerializable

getSerializableFields

public Set<String> getSerializableFields()
Specified by:
getSerializableFields in interface LiquibaseSerializable

getSerializableFieldValue

public Object getSerializableFieldValue(String field)
Specified by:
getSerializableFieldValue in interface LiquibaseSerializable

getSerializableFieldType

public LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
Specified by:
getSerializableFieldType in interface LiquibaseSerializable

getSerializedObjectNamespace

public String getSerializedObjectNamespace()
Specified by:
getSerializedObjectNamespace in interface LiquibaseSerializable

getSerializableFieldNamespace

public String getSerializableFieldNamespace(String field)
Specified by:
getSerializableFieldNamespace in interface LiquibaseSerializable

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2016 Liquibase.org. All rights reserved.