Skip to content

Commit

Permalink
Merge branch 'yuana1-master'
Browse files Browse the repository at this point in the history
fix Oracle show too much tables issue, just show schema tables configured in db connection config, thanks @jianbingguozi code contribution
zouzhigang committed Jan 16, 2018
1 parent 6692539 commit 60d05bf
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -69,6 +69,7 @@ public void generate() throws Exception {
tableConfig.setDeleteByExampleStatementEnabled(false);
tableConfig.setSelectByExampleStatementEnabled(false);
}
tableConfig.setCatalog(selectedDatabaseConfig.getSchema());

// 针对 postgresql 单独配置
if (DbType.valueOf(selectedDatabaseConfig.getDbType()).getDriverClass() == "org.postgresql.Driver") {
4 changes: 3 additions & 1 deletion src/main/java/com/zzg/mybatis/generator/util/DbUtil.java
Original file line number Diff line number Diff line change
@@ -75,7 +75,9 @@ public static List<String> getTableNames(DatabaseConfig config) throws Exception
}
else {
// rs = md.getTables(null, config.getUsername().toUpperCase(), null, null);
rs = md.getTables(null, "%", "%", new String[] {"TABLE", "VIEW"}); //针对 postgresql 的左侧数据表显示


rs = md.getTables(config.getSchema(), null, "%", new String[] {"TABLE", "VIEW"}); //针对 postgresql 的左侧数据表显示
}
while (rs.next()) {
tables.add(rs.getString(3));

0 comments on commit 60d05bf

Please sign in to comment.