Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spring-boot-mybatis/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,19 @@
import org.mybatis.generator.api.PluginAdapter;
import org.mybatis.generator.api.dom.java.FullyQualifiedJavaType;
import org.mybatis.generator.api.dom.java.Interface;
import org.mybatis.generator.api.dom.java.TopLevelClass;

/** Created by qct on 2017/10/5. */
public class BaseMapperGeneratorPlugin extends PluginAdapter {

@Override
public boolean clientGenerated(
Interface interfaze, TopLevelClass topLevelClass, IntrospectedTable introspectedTable) {
public boolean clientGenerated(Interface interfaze, IntrospectedTable introspectedTable) {
// 主键默认采用java.lang.Integer
FullyQualifiedJavaType fqjt = new FullyQualifiedJavaType("BaseMapper<"
+ introspectedTable.getBaseRecordType()
+ ","
+ introspectedTable.getExampleType()
+ ",java.lang.Integer"
+ ">");
+ introspectedTable.getBaseRecordType()
+ ","
+ introspectedTable.getExampleType()
+ ",java.lang.Integer"
+ ">");
FullyQualifiedJavaType imp = new FullyQualifiedJavaType("alex.BaseMapper");

// 添加 extends MybatisBaseMapper
Expand Down