修复针对2017版本报错问题

This commit is contained in:
makejava 2018-09-05 15:22:20 +08:00
parent 5769c951aa
commit e138ff00c3
1 changed files with 8 additions and 1 deletions

View File

@ -287,7 +287,14 @@ public class TemplateSettingPanel implements Configurable {
if (dasTable == null) {
return;
}
DbTable dbTable = (DbTable) DbPsiFacade.getInstance(project).findElement(dasTable);
DbTable dbTable;
if (dasTable instanceof DbTable) {
// 针对2017版本
dbTable = (DbTable) dasTable;
} else {
// 针对2018版本
dbTable = (DbTable) DbPsiFacade.getInstance(project).findElement(dasTable);
}
// 获取表信息
TableInfo tableInfo = TableInfoService.getInstance(project).getTableInfoAndConfig(dbTable);
// 生成代码