Commit c6eed9a6360995c56abccd25f594351e53cd54d0
1 parent
1c9b5dda
【修复】Oracle 自带系统表,影响代码生成
Showing
1 changed file
with
5 additions
and
2 deletions
yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/service/db/DatabaseTableServiceImpl.java
| ... | ... | @@ -49,12 +49,15 @@ public class DatabaseTableServiceImpl implements DatabaseTableService { |
| 49 | 49 | // 使用 MyBatis Plus Generator 解析表结构 |
| 50 | 50 | DataSourceConfig dataSourceConfig = new DataSourceConfig.Builder(config.getUrl(), config.getUsername(), |
| 51 | 51 | config.getPassword()).build(); |
| 52 | - StrategyConfig.Builder strategyConfig = new StrategyConfig.Builder(); | |
| 52 | + StrategyConfig.Builder strategyConfig = new StrategyConfig.Builder().enableSkipView(); // 忽略视图,业务上一般用不到 | |
| 53 | 53 | if (StrUtil.isNotEmpty(name)) { |
| 54 | 54 | strategyConfig.addInclude(name); |
| 55 | 55 | } else { |
| 56 | - // 移除工作流和定时任务前缀的表名 // TODO 未来做成可配置 | |
| 56 | + // 移除工作流和定时任务前缀的表名 | |
| 57 | 57 | strategyConfig.addExclude("ACT_[\\S\\s]+|QRTZ_[\\S\\s]+|FLW_[\\S\\s]+"); |
| 58 | + // 移除 ORACLE 相关的系统表 | |
| 59 | + strategyConfig.addExclude("IMPDP_[\\S\\s]+|ALL_[\\S\\s]+|HS_[\\S\\\\s]+"); | |
| 60 | + strategyConfig.addExclude("[\\S\\s]+\\$[\\S\\s]+|[\\S\\s]+\\$"); // 表里不能有 $,一般有都是系统的表 | |
| 58 | 61 | } |
| 59 | 62 | |
| 60 | 63 | GlobalConfig globalConfig = new GlobalConfig.Builder().dateType(DateType.TIME_PACK).build(); // 只使用 LocalDateTime 类型,不使用 LocalDate | ... | ... |