惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

博客园 - zhuzhipeng

工作难找,我在江心洲摆野串,靠一个工具活下来了 约课系统-约刻 Mysql数据库导出数据字典文档Word或者HTML的3个工具 Linux 中 FTP的安装、apache安装并且设置apache的根目录为ftp用户的根目录 mysql中查看所有表、表字段、表注释、字段注释 CentOS7安装MySQL maven远程下载失败 手动导包到本地仓库 Linux文件权限一:普通权限(rwx) Git 恢复本地误删的文件 Windows安装Redis(转!) Git忽略已经提交过一次文件Git忽略文件 Intellij IDEA调试功能使用总结(step over / step into / force step into/step out等) Maven配置阿里云中心仓库 微信公众号分享时,提示invalid signature,签名错误 简单请求,复杂请求 ubuntu所有php扩展php-7.0扩展列表 Spring Boot整合UEditor不修改源码 beetl模版for循环渲染字符串 Springboot中IDE支持两种打包方式,即jar包和war包
mybatis-generator自动生成代码插件使用详解
zhuzhipeng · 2020-07-06 · via 博客园 - zhuzhipeng

1. 集成mybatis-generator
步骤1:添加idea插件
步骤2:添加server\src\main\resources\generator\generatorConfig.xml
步骤3:创建maven启动命令mybatis-generator:generate -e

<!-- mybatis generator 自动生成代码插件 -->
<plugin>
	<groupId>org.mybatis.generator</groupId>
	<artifactId>mybatis-generator-maven-plugin</artifactId>
	<version>1.3.7</version>
	<configuration>
		<configurationFile>src/main/resources/generator/generatorConfig.xml</configurationFile>
		<overwrite>true</overwrite>
		<verbose>true</verbose>
	</configuration>
	<dependencies>
		<dependency>
			<groupId>mysql</groupId>
			<artifactId>mysql-connector-java</artifactId>
			<version>5.1.37</version>
		</dependency>
	</dependencies>
</plugin>
<?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>
    <context id="Mysql" targetRuntime="MyBatis3" defaultModelType="flat">

        <property name="beginningDelimiter" value="`"/>
        <property name="endingDelimiter" value="`"/>

        <!--覆盖生成XML文件-->
        <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
        <!-- 生成的实体类添加toString()方法 -->
        <plugin type="org.mybatis.generator.plugins.ToStringPlugin" />

        <!-- 不生成注释 -->
        <commentGenerator>
            <property name="suppressAllComments" value="true"/>
        </commentGenerator>

        <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                        connectionURL="jdbc:mysql://localhost:3306/dbname"
                        userId="username"
                        password="password">
        </jdbcConnection>

        <!-- domain实体类的位置 -->
        <javaModelGenerator targetProject="src\main\java"
                            targetPackage="com.xxx.xxxx.domain"/>

        <!-- mapper xml的位置 -->
        <sqlMapGenerator targetProject="src\main\resources"
                         targetPackage="mapper"/>

        <!-- mapper类的位置 -->
        <javaClientGenerator targetProject="src\main\java"
                             targetPackage="com.xxxx.xxxx.mapper"
                             type="XMLMAPPER" />
      
        <table tableName="test" domainObjectName="Test"/>
    </context>
</generatorConfiguration>

创建maven启动命令mybatis-generator:generate -e