|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectliquibase.change.AbstractChange
public abstract class AbstractChange
Standard superclass for Changes to implement. This is a skeletal implementation, as defined in Effective Java#16.
Change| Field Summary | |
|---|---|
protected java.util.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
protected |
AbstractChange(java.lang.String tagName,
java.lang.String changeName)
Constructor with tag name and name |
| Method Summary | |
|---|---|
boolean |
canRollBack()
Can this change be rolled back |
protected Change[] |
createInverses()
|
void |
executeRollbackStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors)
Rolls back the statements in this change against the Database passed as argument |
void |
executeStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors)
Executes the statements in this change against the database passed in the argument |
SqlStatement[] |
generateRollbackStatements(Database database)
Generates the SQL statements required to roll back the change |
java.lang.String |
getChangeName()
Returns the name of this change |
ChangeSet |
getChangeSet()
|
FileOpener |
getFileOpener()
Returns the FileOpen as provided by the creating ChangeLog. |
java.lang.String |
getMD5Sum()
Calculates the MD5 hash for the string representation of the XML element of this change |
java.lang.String |
getTagName()
Returns the tag name of this change |
void |
saveRollbackStatement(Database database,
java.util.List<SqlVisitor> sqlVisitors,
java.io.Writer writer)
Outputs the statements necessary to roll back this change |
void |
saveStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors,
java.io.Writer writer)
Outputs the SQL statements generated by this change |
void |
setChangeSet(ChangeSet changeSet)
|
void |
setFileOpener(FileOpener fileOpener)
Default implementation that stores the file opener provided when the Change was created. |
void |
setUp()
Most Changes don't need to do any setup. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface liquibase.change.Change |
|---|
createNode, generateStatements, getAffectedDatabaseObjects, getConfirmationMessage, validate |
| Field Detail |
|---|
protected java.util.logging.Logger log
| Constructor Detail |
|---|
protected AbstractChange(java.lang.String tagName,
java.lang.String changeName)
tagName - the tag name for this changechangeName - the name for this change| Method Detail |
|---|
public ChangeSet getChangeSet()
getChangeSet in interface Changepublic void setChangeSet(ChangeSet changeSet)
setChangeSet in interface Changepublic java.lang.String getChangeName()
Change
getChangeName in interface ChangeChange.getChangeName()public java.lang.String getTagName()
Change
getTagName in interface ChangeChange.getTagName()
public void executeStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors)
throws JDBCException,
UnsupportedChangeException
Change
executeStatements in interface Changedatabase - the reference to the target Database
to which the statements are executed
JDBCException - if there were problems executing the statements
UnsupportedChangeException - if this change is not supported by the Database passed as argumentChange.executeStatements(liquibase.database.Database, List sqlVisitors)
public void saveStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors,
java.io.Writer writer)
throws java.io.IOException,
UnsupportedChangeException,
StatementNotSupportedOnDatabaseException
Change
saveStatements in interface Changedatabase - the target Database associated to this change's statementswriter - the target Writer to which the statements are appended
java.io.IOException - if there were problems appending the statements to the writer
UnsupportedChangeException - if this change is not supported by the Database passed as argument
StatementNotSupportedOnDatabaseExceptionChange.saveStatements(liquibase.database.Database, List sqlVisitors, java.io.Writer)
public void executeRollbackStatements(Database database,
java.util.List<SqlVisitor> sqlVisitors)
throws JDBCException,
UnsupportedChangeException,
RollbackImpossibleException
ChangeDatabase passed as argument
executeRollbackStatements in interface Changedatabase - the target Database associated to this change's rollback statements
JDBCException - if there were problems executing the rollback statements
UnsupportedChangeException - if this change is not supported by the Database passed as argument
RollbackImpossibleException - if rollback is not supported for this changeChange.executeRollbackStatements(liquibase.database.Database, List sqlVisitor)
public void saveRollbackStatement(Database database,
java.util.List<SqlVisitor> sqlVisitors,
java.io.Writer writer)
throws java.io.IOException,
UnsupportedChangeException,
RollbackImpossibleException,
StatementNotSupportedOnDatabaseException
Change
saveRollbackStatement in interface Changedatabase - the target Database associated to this change's rollback statementswriter - writer the target Writer to which the rollback statements are appended
java.io.IOException - if there were problems appending the rollback statements to the writer
UnsupportedChangeException - if this change is not supported by the Database passed as argument
RollbackImpossibleException - if rollback is not supported for this change
StatementNotSupportedOnDatabaseExceptionChange.saveRollbackStatement(liquibase.database.Database, List sqlVisitor, java.io.Writer)
public SqlStatement[] generateRollbackStatements(Database database)
throws UnsupportedChangeException,
RollbackImpossibleException
Change
generateRollbackStatements in interface Changedatabase - database databasethe target Database associated to this change's rollback statements
Strings with the rollback statements
UnsupportedChangeException - if this change is not supported by the Database passed as argument
RollbackImpossibleException - if rollback is not supported for this changeChange.generateRollbackStatements(liquibase.database.Database)public boolean canRollBack()
Change
canRollBack in interface ChangeChange.canRollBack()public java.lang.String getMD5Sum()
Change
getMD5Sum in interface ChangeChange.getMD5Sum()protected Change[] createInverses()
public void setFileOpener(FileOpener fileOpener)
setFileOpener in interface Changepublic FileOpener getFileOpener()
public void setUp()
throws SetupException
setUp in interface ChangeSetupException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||