Spring Boot Generator

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.