1 | public class MysqlTableTriggerExtractorImpl implements ITableTriggerExtractor {↵ | | 1 | public class PostgresTableIndexExtractorImpl implements ITableIndexExtractor {↵
|
|
| | | 2 | ↵
|
2 | /** Logger for this class */↵ | | 3 | /** Logger for this class */↵
|
3 | private final static ILogger s_log = ↵ | | 4 | private final static ILogger s_log = ↵
|
4 | LoggerController.createLogger(MysqlTableTriggerExtractorImpl.class); ↵ | | 5 | LoggerController.createLogger(PostgresTableIndexExtractorImpl.class);↵
|
5 | ↵ | | 6 | ↵
|
6 | /** The query that finds the trigger definition */↵ | | 7 | /** The query that finds the indexes for a given table */↵
|
7 | private static String SQL = ↵ | | 8 | private static final String query = ↵
|
8 | "select TRIGGER_NAME " +↵ | | 9 | "select indexname " +↵
|
9 | "from information_schema.triggers " +↵ | | 10 | "from pg_catalog.pg_indexes " +↵
|
10 | "where EVENT_OBJECT_SCHEMA = ? " +↵ | | 11 | "where schemaname = ? " +↵
|
11 | "and EVENT_OBJECT_TABLE = ? ";↵ | | 12 | "and tablename = ? ";↵
|
12 | ↵ | | 13 | ↵
|
13 | /**↵ | | 14 | /**↵
|
14 | * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)↵ | | 15 | * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#bindParamters(java.sql.PreparedStatement, net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo)↵
|
15 | */↵ | | 16 | */↵
|
16 | public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo) ↵ | | 17 | public void bindParamters(PreparedStatement pstmt, IDatabaseObjectInfo dbo)↵
|
17 | throws SQLException ↵ | | 18 | throws SQLException ↵
|
18 | {↵ | | 19 | {↵
|
19 | if (s_log.isDebugEnabled()) {↵ | | 20 | if (s_log.isDebugEnabled()) {↵
|
20 | s_log.debug("Binding catalog name "+dbo.getCatalogName()+↵ | | 21 | s_log.debug("Binding schema name "+dbo.getSchemaName()+↵
|
21 | " as first bind value");↵ | | 22 | " as first bind value");↵
|
22 | s_log.debug("Binding table name "+dbo.getSimpleName()+↵ | | 23 | s_log.debug("Binding table name "+dbo.getSimpleName()+↵
|
23 | " as second bind value"); ↵ | | 24 | " as second bind value"); ↵
|
24 | }↵ | | 25 | } ↵
|
25 | pstmt.setString(1, dbo.getCatalogName());↵ | | 26 | pstmt.setString(1, dbo.getSchemaName());↵
|
26 | pstmt.setString(2, dbo.getSimpleName()); ↵ | | 27 | pstmt.setString(2, dbo.getSimpleName());↵
|
27 | }↵ | | 28 | }↵
|
|
28 | /**↵ | | 29 | /**↵
|
29 | * @see net.sourceforge.squirrel_sql.plugins.derby.exp.ITableTriggerExtractor#getTableTriggerQuery()↵ | | 30 | * @see net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.ITableIndexExtractor#getTableIndexQuery()↵
|
30 | */↵ | | 31 | */↵
|
31 | public String getTableTriggerQuery() {↵ | | 32 | public String getTableIndexQuery() {↵
|
32 | return SQL | | 33 | return query
|