Commit 6e9a283a authored by hewei's avatar hewei

fixed Issue #3 紧急修正逻辑删除插件引入的异常

parent 476b2783
......@@ -21,7 +21,7 @@ Maven引用:
<dependency>
<groupId>com.itfsw</groupId>
<artifactId>mybatis-generator-plugin</artifactId>
<version>1.0.7</version>
<version>1.0.8</version>
</dependency>
```
---------------------------------------
......
......@@ -133,12 +133,13 @@ public class LogicalDeletePlugin extends BasePlugin {
public boolean clientGenerated(Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
if (this.logicalDeleteColumn != null){
// 1. 逻辑删除ByExample
Method mLogicalDeleteByExample = new Method(METHOD_LOGICAL_DELETE_BY_EXAMPLE);
// 返回值类型
mLogicalDeleteByExample.setReturnType(FullyQualifiedJavaType.getIntInstance());
// 添加参数
FullyQualifiedJavaType type = new FullyQualifiedJavaType(introspectedTable.getExampleType());
mLogicalDeleteByExample.addParameter(new Parameter(type, "example"));
Method mLogicalDeleteByExample = JavaElementGeneratorTools.generateMethod(
METHOD_LOGICAL_DELETE_BY_EXAMPLE,
JavaVisibility.DEFAULT,
FullyQualifiedJavaType.getIntInstance(),
new Parameter(new FullyQualifiedJavaType(introspectedTable.getExampleType()), "example", "@Param(\"example\")")
);
// 添加方法说明
commentGenerator.addGeneralMethodComment(mLogicalDeleteByExample, introspectedTable);
// interface 增加方法
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment