From e138ff00c3f66ca3fafaa3658b2c575923989d68 Mon Sep 17 00:00:00 2001 From: makejava <1353036300@qq.com> Date: Wed, 5 Sep 2018 15:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=92=88=E5=AF=B92017?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/sjhy/plugin/ui/TemplateSettingPanel.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sjhy/plugin/ui/TemplateSettingPanel.java b/src/main/java/com/sjhy/plugin/ui/TemplateSettingPanel.java index 5a73922..155cf08 100644 --- a/src/main/java/com/sjhy/plugin/ui/TemplateSettingPanel.java +++ b/src/main/java/com/sjhy/plugin/ui/TemplateSettingPanel.java @@ -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); // 生成代码