liquibase.changelog
Class ChangeSet

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

public class ChangeSet
extends Object
implements Conditional, LiquibaseSerializable

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
 
Fields inherited from interface liquibase.serializer.LiquibaseSerializable
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE
 
Constructor Summary
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)
           
 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()
           
 Contexts getContexts()
           
 Set<String> getDbmsSet()
           
 String getDescription()
           
 Boolean getFailOnError()
           
 String getFilePath()
           
 String getId()
           
 ObjectQuotingStrategy getObjectQuotingStrategy()
           
 ChangeSet.ValidationFailOption getOnValidationFail()
           
 PreconditionContainer getPreconditions()
           
 Change[] getRollBackChanges()
           
 Set<String> getSerializableFields()
           
 LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
           
 Object getSerializableFieldValue(String field)
           
 String getSerializedObjectName()
           
 String getSerializedObjectNamespace()
           
 List<SqlVisitor> getSqlVisitors()
           
 boolean isAlwaysRun()
           
 boolean isCheckSumValid(CheckSum storedCheckSum)
           
 boolean isRunInTransaction()
           
 boolean isRunOnChange()
           
 void rollback(Database database)
           
 void setChangeLogParameters(ChangeLogParameters changeLogParameters)
          Called by the changelog parsing process to pass the ChangeLogParameters.
 void setComments(String comments)
           
 void setFailOnError(Boolean failOnError)
           
 void setOnValidationFail(ChangeSet.ValidationFailOption onValidationFail)
           
 void setPreconditions(PreconditionContainer preconditionContainer)
           
 void setValidationFailed(boolean validationFailed)
           
 boolean shouldAlwaysRun()
           
 boolean shouldRunOnChange()
           
 boolean supportsRollback(Database database)
           
 String toString()
           
 String toString(boolean includeMD5Sum)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

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()

getFilePath

public String getFilePath()

generateCheckSum

public CheckSum generateCheckSum()

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

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 Contexts getContexts()

getDbmsSet

public Set<String> getDbmsSet()

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()

getRollBackChanges

public Change[] getRollBackChanges()

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)

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.


getObjectQuotingStrategy

public ObjectQuotingStrategy getObjectQuotingStrategy()

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


Copyright © 2014 Liquibase.org. All Rights Reserved.