Package liquibase.executor.jvm
Class ExampleExecutor
- java.lang.Object
-
- liquibase.executor.AbstractExecutor
-
- liquibase.executor.jvm.JdbcExecutor
-
- liquibase.executor.jvm.ExampleExecutor
-
public class ExampleExecutor extends JdbcExecutor
This is an example of a customExecutorimplementation which can be specified in a changelog with the "runWith" attribute
-
-
Field Summary
-
Fields inherited from class liquibase.executor.AbstractExecutor
database, resourceAccessor
-
Fields inherited from interface liquibase.plugin.Plugin
PRIORITY_DATABASE, PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
-
-
Constructor Summary
Constructors Constructor Description ExampleExecutor()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecute(SqlStatement action, List<SqlVisitor> sqlVisitors)Execute the SQL from theSqlStatementparameterStringgetName()Return the name of the ExecutorintgetPriority()Return the Executor priorityValidationErrorsvalidate(ChangeSet changeSet)Validate whether the changeset can be executed by this Executor-
Methods inherited from class liquibase.executor.jvm.JdbcExecutor
comment, execute, execute, execute, getColumnMapRowMapper, getSingleColumnRowMapper, query, query, query, query, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForObject, queryForObject, update, update, updatesDatabase
-
Methods inherited from class liquibase.executor.AbstractExecutor
applyVisitors, execute, execute, modifyChangeSet, setDatabase, setResourceAccessor
-
-
-
-
Method Detail
-
getName
public String getName()
Return the name of the Executor- Specified by:
getNamein interfaceExecutor- Overrides:
getNamein classJdbcExecutor- Returns:
- String The Executor name
-
getPriority
public int getPriority()
Return the Executor priority- Specified by:
getPriorityin interfaceExecutor- Overrides:
getPriorityin classJdbcExecutor- Returns:
- int The Executor priority
-
validate
public ValidationErrors validate(ChangeSet changeSet)
Validate whether the changeset can be executed by this Executor- Specified by:
validatein interfaceExecutor- Overrides:
validatein classAbstractExecutor- Parameters:
changeSet- The changeset to validate- Returns:
- boolean True if all changes can be executed by the custom Executor False if any change cannot be executed
-
execute
public void execute(SqlStatement action, List<SqlVisitor> sqlVisitors) throws DatabaseException
Execute the SQL from theSqlStatementparameter- Specified by:
executein interfaceExecutor- Overrides:
executein classJdbcExecutor- Parameters:
action- This is the SqlStatement object which contains the SQL to executesqlVisitors- List ofSqlVisitorto apply to the generated SQL- Throws:
DatabaseException- Exception type thrown if an error occurs during execution
-
-