public class JdbcExecutor extends AbstractExecutor implements Executor
database
Constructor and Description |
---|
JdbcExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
comment(String message)
Adds a comment to the database.
|
Object |
execute(liquibase.executor.jvm.CallableStatementCallback action,
List<SqlVisitor> sqlVisitors) |
void |
execute(Change change)
Write methods
|
void |
execute(Change change,
List<SqlVisitor> sqlVisitors) |
void |
execute(SqlStatement sql) |
void |
execute(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
Object |
execute(liquibase.executor.jvm.StatementCallback action,
List<SqlVisitor> sqlVisitors) |
protected RowMapper |
getColumnMapRowMapper()
Create a new RowMapper for reading columns as key-value pairs.
|
protected RowMapper |
getSingleColumnRowMapper(Class requiredType)
Create a new RowMapper for reading result objects from a single column.
|
Object |
query(SqlStatement sql,
liquibase.executor.jvm.ResultSetExtractor rse) |
Object |
query(SqlStatement sql,
liquibase.executor.jvm.ResultSetExtractor rse,
List<SqlVisitor> sqlVisitors) |
List |
query(SqlStatement sql,
RowMapper rowMapper) |
List |
query(SqlStatement sql,
RowMapper rowMapper,
List<SqlVisitor> sqlVisitors) |
int |
queryForInt(SqlStatement sql) |
int |
queryForInt(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
List<Map<String,?>> |
queryForList(SqlStatement sql) |
List |
queryForList(SqlStatement sql,
Class elementType) |
List |
queryForList(SqlStatement sql,
Class elementType,
List<SqlVisitor> sqlVisitors) |
List<Map<String,?>> |
queryForList(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
long |
queryForLong(SqlStatement sql) |
long |
queryForLong(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
<T> T |
queryForObject(SqlStatement sql,
Class<T> requiredType)
Read methods
|
<T> T |
queryForObject(SqlStatement sql,
Class<T> requiredType,
List<SqlVisitor> sqlVisitors) |
Object |
queryForObject(SqlStatement sql,
RowMapper rowMapper) |
Object |
queryForObject(SqlStatement sql,
RowMapper rowMapper,
List<SqlVisitor> sqlVisitors) |
int |
update(SqlStatement sql) |
int |
update(SqlStatement sql,
List<SqlVisitor> sqlVisitors) |
boolean |
updatesDatabase() |
applyVisitors, setDatabase
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setDatabase
public boolean updatesDatabase()
updatesDatabase
in interface Executor
public Object execute(liquibase.executor.jvm.StatementCallback action, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public void execute(Change change) throws DatabaseException
Executor
execute
in interface Executor
DatabaseException
public void execute(Change change, List<SqlVisitor> sqlVisitors) throws DatabaseException
execute
in interface Executor
DatabaseException
public Object execute(liquibase.executor.jvm.CallableStatementCallback action, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public void execute(SqlStatement sql) throws DatabaseException
execute
in interface Executor
DatabaseException
public void execute(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
execute
in interface Executor
DatabaseException
public Object query(SqlStatement sql, liquibase.executor.jvm.ResultSetExtractor rse) throws DatabaseException
DatabaseException
public Object query(SqlStatement sql, liquibase.executor.jvm.ResultSetExtractor rse, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public List query(SqlStatement sql, RowMapper rowMapper) throws DatabaseException
DatabaseException
public List query(SqlStatement sql, RowMapper rowMapper, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public Object queryForObject(SqlStatement sql, RowMapper rowMapper) throws DatabaseException
DatabaseException
public Object queryForObject(SqlStatement sql, RowMapper rowMapper, List<SqlVisitor> sqlVisitors) throws DatabaseException
DatabaseException
public <T> T queryForObject(SqlStatement sql, Class<T> requiredType) throws DatabaseException
Executor
queryForObject
in interface Executor
DatabaseException
public <T> T queryForObject(SqlStatement sql, Class<T> requiredType, List<SqlVisitor> sqlVisitors) throws DatabaseException
queryForObject
in interface Executor
DatabaseException
public long queryForLong(SqlStatement sql) throws DatabaseException
queryForLong
in interface Executor
DatabaseException
public long queryForLong(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
queryForLong
in interface Executor
DatabaseException
public int queryForInt(SqlStatement sql) throws DatabaseException
queryForInt
in interface Executor
DatabaseException
public int queryForInt(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
queryForInt
in interface Executor
DatabaseException
public List queryForList(SqlStatement sql, Class elementType) throws DatabaseException
queryForList
in interface Executor
DatabaseException
public List queryForList(SqlStatement sql, Class elementType, List<SqlVisitor> sqlVisitors) throws DatabaseException
queryForList
in interface Executor
DatabaseException
public List<Map<String,?>> queryForList(SqlStatement sql) throws DatabaseException
queryForList
in interface Executor
DatabaseException
public List<Map<String,?>> queryForList(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
queryForList
in interface Executor
DatabaseException
public int update(SqlStatement sql) throws DatabaseException
update
in interface Executor
DatabaseException
public int update(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException
update
in interface Executor
DatabaseException
protected RowMapper getColumnMapRowMapper()
ColumnMapRowMapper
protected RowMapper getSingleColumnRowMapper(Class requiredType)
requiredType
- the type that each result object is expected to matchSingleColumnRowMapper
public void comment(String message) throws DatabaseException
Executor
comment
in interface Executor
DatabaseException
Copyright © 2016 Liquibase.org. All rights reserved.