|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Change
Interface all changes (refactorings) implement.
How changes are constructed and run when reading changelogs:Implementing automatic rollback support
The easiest way to allow automatic rollback support is by overriding the createInverses() method.
If there are no corresponding inverse changes, you can override the generateRollbackStatements(*) and canRollBack() methods.
ChangeFactory
,
Database
Method Summary | |
---|---|
CheckSum |
generateCheckSum()
Calculates the checksum (currently MD5 hash) for the current configuration of this change. |
SqlStatement[] |
generateRollbackStatements(Database database)
Generates the SQL statements required to roll back the change |
SqlStatement[] |
generateStatements(Database database)
Generates the SQL statements required to run the change |
Set<DatabaseObject> |
getAffectedDatabaseObjects(Database database)
|
ChangeMetaData |
getChangeMetaData()
|
ChangeSet |
getChangeSet()
|
String |
getConfirmationMessage()
|
void |
init()
This method will be called after the no arg constructor and all of the properties have been set to allow the task to do any heavy tasks or more importantly generate any exceptions to report to the user about the settings provided. |
boolean |
requiresUpdatedDatabaseMetadata(Database database)
Does this change require access to the database metadata? If true, the change cannot be used in an updateSql-style command. |
void |
setChangeLogParameters(ChangeLogParameters changeLogParameters)
|
void |
setChangeSet(ChangeSet changeSet)
|
void |
setResourceAccessor(ResourceAccessor resourceAccessor)
Sets the fileOpener that should be used for any file loading and resource finding for files that are provided by the user. |
boolean |
supports(Database database)
|
boolean |
supportsRollback(Database database)
Can this change be rolled back |
ValidationErrors |
validate(Database database)
|
Warnings |
warn(Database database)
|
Method Detail |
---|
ChangeMetaData getChangeMetaData()
ChangeSet getChangeSet()
void setChangeSet(ChangeSet changeSet)
void setResourceAccessor(ResourceAccessor resourceAccessor)
void init() throws SetupException
SetupException
boolean supports(Database database)
Warnings warn(Database database)
ValidationErrors validate(Database database)
Set<DatabaseObject> getAffectedDatabaseObjects(Database database)
CheckSum generateCheckSum()
String getConfirmationMessage()
SqlStatement[] generateStatements(Database database)
database
- databasethe target Database
associated to this change's statements
String
s with the statementsboolean supportsRollback(Database database)
database
-
SqlStatement[] generateRollbackStatements(Database database) throws UnsupportedChangeException, RollbackImpossibleException
database
- database databasethe target Database
associated to this change's rollback statements
String
s 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 changeboolean requiresUpdatedDatabaseMetadata(Database database)
void setChangeLogParameters(ChangeLogParameters changeLogParameters)
changeLogParameters
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |