Skip to content

Commit

Permalink
添加dasUtil dbUtil高级工具类
Browse files Browse the repository at this point in the history
  • Loading branch information
makejavas committed Apr 21, 2020
1 parent 8da3360 commit b310801
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public Collection<VtlVariable> getGlobalVariables(@NotNull VtlFile file) {
result.add(new VtlLightVariable("tableInfo", file, "com.sjhy.plugin.entity.TableInfo"));
result.add(new VtlLightVariable("tableInfoList", file, "java.util.List<com.sjhy.plugin.entity.TableInfo>"));
result.add(new VtlLightVariable("generateService", file, "com.sjhy.plugin.tool.ExtraCodeGenerateUtils"));
result.add(new VtlLightVariable("dbUtil", file, "com.intellij.database.util.DbUtil"));
result.add(new VtlLightVariable("dasUtil", file, "com.intellij.database.util.DasUtil"));
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.module.ModuleUtil;
import com.intellij.openapi.project.Project;
import com.intellij.util.ReflectionUtil;
import com.sjhy.plugin.config.Settings;
import com.sjhy.plugin.entity.Callback;
import com.sjhy.plugin.entity.SaveFile;
Expand Down Expand Up @@ -212,8 +213,8 @@ private Map<String, Object> getDefaultParam() {
// 项目路径
param.put("projectPath", project.getBasePath());
// Database数据库工具
param.put("dbUtil", DbUtil.class);
param.put("dasUtil", DasUtil.class);
param.put("dbUtil", ReflectionUtil.newInstance(DbUtil.class));
param.put("dasUtil", ReflectionUtil.newInstance(DasUtil.class));
return param;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/description/templateDescription.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
currTime(String format) 获取当前时间,指定时间格式(默认:yyyy-MM-dd HH:mm:ss)
$generateService
run(String, Map&lt;String,Object&gt;) 代码生成服务,参数1:模板名称,参数2:附加参数。
$dasUtil Database提供的工具类,具体可方法请查看源码,适用于高端玩家
$dbUtil Database提供的工具类,具体可方法请查看源码,适用于高端玩家
</pre>
</body>
</html>
3 changes: 1 addition & 2 deletions src/main/resources/string.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
button.reset=\u91CD\u7F6E\u9ED8\u8BA4\u8BBE\u7F6E
button.type.mapper.copy.group=Copy Group
label.all=&All
label.version=&\u5f53\u524d\u7248\u672c\uFF1A
label.version=&\u5F53\u524D\u7248\u672C\uFF1A
label.author.name=&\u4F5C\u8005\u540D\u79F0\uFF1A
label.cancel=&Cancel
label.choose=&Choose
label.default.encode=&\u9ED8\u8BA4\u7F16\u7801\uFF1A
label.module=&Module:
label.ok=&OK
label.package=&Package:
Expand Down

0 comments on commit b310801

Please sign in to comment.