public class LoggingExecutor extends AbstractExecutor
database
Constructor and Description |
---|
LoggingExecutor(Executor delegatedExecutor,
Writer output,
Database database) |
Modifier and Type | Method and Description |
---|---|
void |
comment(String message)
Adds a comment to the database.
|
void |
execute(SqlStatement sql) |
void |
execute(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
protected Writer |
getOutput() |
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.
|
int |
update(SqlStatement sql) |
int |
update(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
boolean |
updatesDatabase() |
applyVisitors, execute, execute, setDatabase
protected Writer getOutput()
public void execute(SqlStatement sql) throws DatabaseException
DatabaseException
public int update(SqlStatement sql) throws DatabaseException
DatabaseException
public void execute(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public int update(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public void comment(String message) throws DatabaseException
Executor
DatabaseException
public <T> T queryForObject(SqlStatement sql, Class<T> requiredType) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic <T> T queryForObject(SqlStatement sql, Class<T> requiredType, List<SqlVisitor> sqlVisitors) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic long queryForLong(SqlStatement sql) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic long queryForLong(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic int queryForInt(SqlStatement sql) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic int queryForInt(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
Executor
sql
- The query to executeDatabaseException
- in case something goes wrong during the query executionpublic List queryForList(SqlStatement sql, Class elementType) throws DatabaseException
DatabaseException
public List queryForList(SqlStatement sql, Class elementType, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public List<Map<String,?>> queryForList(SqlStatement sql) throws DatabaseException
Executor
sql
- the SQL query to executeDatabaseException
- if an error occurs during SQL processing (e.g. the SQL is not valid for the database)public List<Map<String,?>> queryForList(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
Executor
sql
- the SQL query to executeDatabaseException
- if an error occurs during SQL processing (e.g. the SQL is not valid for the database)public boolean updatesDatabase()
Copyright © 2020 Liquibase.org. All rights reserved.