Skip to content

Commit

Permalink
add getTriggers
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderrd committed Jul 1, 2016
1 parent 045a246 commit 918fad4
Showing 1 changed file with 27 additions and 1 deletion.
Expand Up @@ -52,6 +52,7 @@
import org.jumpmind.db.model.PlatformColumn;
import org.jumpmind.db.model.Reference;
import org.jumpmind.db.model.Table;
import org.jumpmind.db.model.Trigger;
import org.jumpmind.db.model.TypeMap;
import org.jumpmind.db.model.UniqueIndex;
import org.jumpmind.db.sql.IConnectionCallback;
Expand Down Expand Up @@ -130,6 +131,12 @@ public AbstractJdbcDdlReader(IDatabasePlatform platform) {
_columnsForFK = initColumnsForFK();
_columnsForIndex = initColumnsForIndex();
}

@Override
public List<Trigger> getTriggers(String catalog, String schema,
String tableName) {
return Collections.emptyList();
}

/*
* Returns the platform that this model reader belongs to.
Expand Down Expand Up @@ -1358,7 +1365,10 @@ public List<String> execute(Connection connection) throws SQLException {
try {
rs = meta.getCatalogs();
while (rs.next()) {
catalogs.add(rs.getString(1));
String catalog = rs.getString(1);
if (catalog != null) {
catalogs.add(catalog);
}
}
return catalogs;
} finally {
Expand Down Expand Up @@ -1442,5 +1452,21 @@ public List<String> execute(Connection connection) throws SQLException {
}
});
}

public List<String> getListOfTriggers() {
return new ArrayList<String>();
}

public Trigger getTriggerFor(Table table, String triggerName) {
Trigger trigger = null;
List<Trigger> triggers = getTriggers(table.getCatalog(), table.getSchema(), table.getName());
for (Trigger t : triggers) {
if (t.getName().equals(triggerName)) {
trigger = t;
break;
}
}
return trigger;
}

}

0 comments on commit 918fad4

Please sign in to comment.