Pom.xml Plug-in
Reference dependency
<build>
<plugins>
<plugin>
<groupid>org.springframework.boot</groupid>
<artifactid>spring-boot-maven-plugin</artifactid>
</plugin>
<plugin>
<groupid>org.mybatis.generator</groupid>
<artifactid>mybatis-generator-maven-plugin</artifactid>
<version>1.3.2</version>
<configuration>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
</plugin>
</plugins>
</build>
Generatorconfig.xml
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE generatorconfiguration
Public "-//mybatis.org//dtd MyBatis Generator Configuration 1.0//en"
"Http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
<generatorConfiguration>
<!--database driver: Select your local hard drive above the database driver package--
<classpathentry location= "D:\local\maven-repo\mysql\mysql-connector-java\5.1.45\ Mysql-connector-java-5.1.45.jar "/>
<context id= "Db2tables" targetruntime= "MyBatis3" >
<commentGenerator>
<property name= "Suppressdate" value= "true"/>
<!--whether to remove automatically generated comments true: Yes: false: no--
<property name= "Suppressallcomments" value= "true"/>
</commentGenerator>
<!--database link URL, user name, password--
<jdbcconnection driverclass= "Com.mysql.jdbc.Driver" connectionurl= "Jdbc:mysql://localhost/htsc_aimap" userId= " Root "password=" Shagua ">
</jdbcConnection>
<javaTypeResolver>
<property name= "Forcebigdecimals" value= "false"/>
</javaTypeResolver>
<!--generate the package name and location of the model--
<javamodelgenerator targetpackage= "com.htsc.aimap.model.event" targetproject= "Src/main/java" >
<property name= "Enablesubpackages" value= "true"/>
<property name= "Trimstrings" value= "true"/>
</javaModelGenerator>
<!--generate the package name and location of the mapping file--
<sqlmapgenerator targetpackage= "mapping.event" targetproject= "Src/main/resources" >
<property name= "Enablesubpackages" value= "true"/>
</sqlMapGenerator>
<!--generate DAO's package name and location--
<javaclientgenerator type= "Xmlmapper" targetpackage= "com.htsc.aimap.mapper.event" targetproject= "Src/main/java ">
<property name= "Enablesubpackages" value= "true"/>
</javaClientGenerator>
<!--the table TableName to be generated is the table name or view name in the database Domainobjectname is the entity class name--
<!--<table tablename= "Taskflow" domainobjectname= "Taskflow" ></table>-->
<table tablename= "sc_event" Domainobjectname= "event" enablecountbyexample= "false" enableupdatebyexample= "false" Enabledeletebyexample= "false" enableselectbyexample= "false" Selectbyexamplequeryid= "false" ></table>
</context>
</generatorConfiguration>
Start maven-> command line
Mybatis-generator:generate
Spring Boot Generator