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 customExecutor
implementation 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 void
execute(SqlStatement action, List<SqlVisitor> sqlVisitors)
Execute the SQL from theSqlStatement
parameterString
getName()
Return the name of the Executorint
getPriority()
Return the Executor priorityValidationErrors
validate(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:
getName
in interfaceExecutor
- Overrides:
getName
in classJdbcExecutor
- Returns:
- String The Executor name
-
getPriority
public int getPriority()
Return the Executor priority- Specified by:
getPriority
in interfaceExecutor
- Overrides:
getPriority
in classJdbcExecutor
- Returns:
- int The Executor priority
-
validate
public ValidationErrors validate(ChangeSet changeSet)
Validate whether the changeset can be executed by this Executor- Specified by:
validate
in interfaceExecutor
- Overrides:
validate
in 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 theSqlStatement
parameter- Specified by:
execute
in interfaceExecutor
- Overrides:
execute
in classJdbcExecutor
- Parameters:
action
- This is the SqlStatement object which contains the SQL to executesqlVisitors
- List ofSqlVisitor
to apply to the generated SQL- Throws:
DatabaseException
- Exception type thrown if an error occurs during execution
-
-