public interface Executor extends Plugin
PRIORITY_DEFAULT, PRIORITY_NOT_APPLICABLE, PRIORITY_SPECIALIZED
Modifier and Type | Method and Description |
---|---|
void |
comment(String message)
Adds a comment to the database.
|
void |
execute(Change change)
Write methods
|
void |
execute(Change change,
List<SqlVisitor> sqlVisitors) |
void |
execute(SqlStatement sql) |
void |
execute(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
String |
getName()
Return the name of the Executor
|
int |
getPriority()
Return the Executor priority
|
void |
modifyChangeSet(ChangeSet changeSet)
Allow this Executor to make any needed changes to the changeset
|
int |
queryForInt(SqlStatement sql)
Executes a query that is expected to return a scalar (1 row, 1 column).
|
int |
queryForInt(SqlStatement sql,
List<SqlVisitor> sqlVisitors)
Applies a number of SqlVisitors to the sql query.
|
List<Map<String,?>> |
queryForList(SqlStatement sql)
Executes a given SQL statement and returns a List of rows.
|
List |
queryForList(SqlStatement sql,
Class elementType) |
List |
queryForList(SqlStatement sql,
Class elementType,
List<SqlVisitor> sqlVisitors) |
List<Map<String,?>> |
queryForList(SqlStatement sql,
List<SqlVisitor> sqlVisitors)
Applies a list of SqlVisitors to the SQL query, then executes the (possibly modified) SQL query and lastly,
returns the list of rows.
|
long |
queryForLong(SqlStatement sql)
Executes a query that is expected to return a scalar (1 row, 1 column).
|
long |
queryForLong(SqlStatement sql,
List<SqlVisitor> sqlVisitors)
Applies a number of SqlVisitors to the sql query.
|
<T> T |
queryForObject(SqlStatement sql,
Class<T> requiredType)
Execute a query that is expected to return a scalar (1 row, 1 column).
|
<T> T |
queryForObject(SqlStatement sql,
Class<T> requiredType,
List<SqlVisitor> sqlVisitors)
Applies a number of SqlVisitors to the sql query.
|
void |
setDatabase(Database database)
Configures the Executor for the Database to run statements/queries against.
|
void |
setResourceAccessor(ResourceAccessor resourceAccessor)
Set a ResourceAccessor on this Executor to be used in file access
|
default boolean |
supports(Database database)
Default implementation for compatibility with a Database.
|
int |
update(SqlStatement sql) |
int |
update(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
boolean |
updatesDatabase() |
ValidationErrors |
validate(ChangeSet changeSet)
Validate if the changeset can be executed by this Executor
If the ChangeSet can be executed return an empty ValidationErrors object
otherwise return the errors
|
String getName()
int getPriority()
ValidationErrors validate(ChangeSet changeSet)
changeSet
- The changeset to validatevoid modifyChangeSet(ChangeSet changeSet)
changeSet
- The changeset to operate onvoid setResourceAccessor(ResourceAccessor resourceAccessor)
resourceAccessor
- void setDatabase(Database database)
database
- The database<T> T queryForObject(SqlStatement sql, Class<T> requiredType) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query execution<T> T queryForObject(SqlStatement sql, Class<T> requiredType, List<SqlVisitor> sqlVisitors) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionlong queryForLong(SqlStatement sql) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionlong queryForLong(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionint queryForInt(SqlStatement sql) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionint queryForInt(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionList queryForList(SqlStatement sql, Class elementType) throws DatabaseException
DatabaseException
List queryForList(SqlStatement sql, Class elementType, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
List<Map<String,?>> queryForList(SqlStatement sql) throws DatabaseException
sql
- the SQL query to executeDatabaseException
- if an error occurs during SQL processing (e.g. the SQL is not valid for the database)List<Map<String,?>> queryForList(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
sql
- the SQL query to executeDatabaseException
- if an error occurs during SQL processing (e.g. the SQL is not valid for the database)void execute(Change change) throws DatabaseException
DatabaseException
void execute(Change change, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
void execute(SqlStatement sql) throws DatabaseException
DatabaseException
void execute(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
int update(SqlStatement sql) throws DatabaseException
DatabaseException
int update(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
void comment(String message) throws DatabaseException
message
- DatabaseException
boolean updatesDatabase()
default boolean supports(Database database)
database
- the Database implementation opened from a url connection stringCopyright © 2023 Liquibase.org. All rights reserved.