View Javadoc

1   package liquibase.executor;
2   
3   import liquibase.database.Database;
4   import liquibase.exception.DatabaseException;
5   import liquibase.sql.visitor.SqlVisitor;
6   import liquibase.statement.CallableSqlStatement;
7   import liquibase.statement.SqlStatement;
8   
9   import java.util.List;
10  import java.util.Map;
11  
12  public interface Executor {
13  
14      void setDatabase(Database database);
15  
16      /** Read methods */
17      Object queryForObject(SqlStatement sql, Class requiredType) throws DatabaseException;
18  
19      Object queryForObject(SqlStatement sql, Class requiredType, List<SqlVisitor> sqlVisitors) throws DatabaseException;
20  
21      long queryForLong(SqlStatement sql) throws DatabaseException;
22  
23      long queryForLong(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException;
24  
25      int queryForInt(SqlStatement sql) throws DatabaseException;
26  
27      int queryForInt(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException;
28  
29      List queryForList(SqlStatement sql, Class elementType) throws DatabaseException;
30  
31      List queryForList(SqlStatement sql, Class elementType, List<SqlVisitor> sqlVisitors) throws DatabaseException;
32  
33      List<Map> queryForList(SqlStatement sql) throws DatabaseException;
34  
35      List<Map> queryForList(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException;
36  
37      /** Write methods */
38      void execute(SqlStatement sql) throws DatabaseException;
39  
40      void execute(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException;
41  
42      int update(SqlStatement sql) throws DatabaseException;
43  
44      int update(SqlStatement sql, List<SqlVisitor> sqlVisitors) throws DatabaseException;
45  
46      Map call(CallableSqlStatement csc, List declaredParameters, List<SqlVisitor> sqlVisitors) throws DatabaseException;
47  
48      /**
49       * Adds a comment to the database. Currently does nothing but is over-ridden in the output JDBC template
50       * 
51       * @param message
52       * @throws liquibase.exception.DatabaseException
53       */
54      void comment(String message) throws DatabaseException;
55  
56      boolean updatesDatabase();
57  }