|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectliquibase.change.AbstractChange
liquibase.change.custom.CustomChangeWrapper
public class CustomChangeWrapper
Adapts CustomChange implementations to the standard change system used by Liquibase. Custom change implementations should implement CustomSqlChange or CustomTaskChange
CustomSqlChange,
CustomTaskChange| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable |
|---|
LiquibaseSerializable.SerializationType |
| Constructor Summary | |
|---|---|
CustomChangeWrapper()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CustomChangeWrapper()
| Method Detail |
|---|
public boolean generateStatementsVolatile(Database database)
AbstractChangeSqlGenerator.generateStatementsIsVolatile(Database) method on the SqlStatement objects returned by Change.generateStatements(liquibase.database.Database).
If zero or null SqlStatements are returned by generateStatements then this method returns false.
generateStatementsVolatile in interface ChangegenerateStatementsVolatile in class AbstractChangepublic CustomChange getCustomChange()
setClass(String).
public ClassLoader getClassLoader()
setClass(String).
public void setClassLoader(ClassLoader classLoader)
public CustomChangeWrapper setClass(String className)
throws CustomChangeException
getClassLoader() or fallback methods
and assigns it to getCustomChange().
setClassLoader(ClassLoader) must be called before this method. The passed class is constructed, but no parameters are set. They are set in Change.generateStatements(liquibase.database.Database)
CustomChangeExceptionpublic String getClassName()
setClass(String)
public void setParam(String name,
String value)
Change.generateStatements(liquibase.database.Database) or generateRollbackStatements(liquibase.database.Database) on it.
The CustomChange class must have a set method for the given parameter. For example, to call setParam("lastName", "X") you must have a method setLastName(String val) on your class.
public SortedSet<String> getParams()
setParam(String, String). If no parameters are set, an empty set will be returned
public String getParamValue(String key)
setParam(String, String). If the parameter was not set, null will be returned.
public ValidationErrors validate(Database database)
CustomChange.validate(liquibase.database.Database) method and return the result.
validate in interface Changevalidate in class AbstractChangepublic Warnings warn(Database database)
warn in interface Changewarn in class AbstractChangepublic SqlStatement[] generateStatements(Database database)
setParam(String, String) then calls CustomSqlChange.generateStatements(liquibase.database.Database)
or CustomTaskChange.execute(liquibase.database.Database) depending on the CustomChange implementation.
If the CustomChange returns a null SqlStatement array, this method returns an empty array. If a CustomTaskChange is being used, this method will return an empty array.
public SqlStatement[] generateRollbackStatements(Database database)
throws RollbackImpossibleException
setParam(String, String) then calls CustomSqlRollback.generateRollbackStatements(liquibase.database.Database)
or CustomTaskRollback.rollback(liquibase.database.Database) depending on the CustomChange implementation.
If the CustomChange returns a null SqlStatement array, this method returns an empty array. If a CustomTaskChange is being used, this method will return an empty array.
Any RollbackImpossibleException exceptions thrown by the CustomChange will thrown by this method.
generateRollbackStatements in interface ChangegenerateRollbackStatements in class AbstractChangeRollbackImpossibleException - if rollback is not supported for this changepublic boolean supportsRollback(Database database)
generateRollbackStatements(liquibase.database.Database) may still trow a RollbackImpossibleException when it is actually exectued, even if this method returns true.
Currently only checks if the customChange implements CustomSqlRollback
supportsRollback in interface ChangesupportsRollback in class AbstractChangepublic String getConfirmationMessage()
CustomChange.getConfirmationMessage() message as the Change's message.
public LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
getSerializableFieldType in interface LiquibaseSerializablegetSerializableFieldType in class AbstractChangepublic Object getSerializableFieldValue(String field)
getSerializableFieldValue in interface LiquibaseSerializablegetSerializableFieldValue in class AbstractChangepublic Set<String> getSerializableFields()
AbstractChange
getSerializableFields in interface LiquibaseSerializablegetSerializableFields in class AbstractChange
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||