一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】 Mybatis Generator最完整配置详解: MyBatis Generator 详解

一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】
Mybatis Generator最完整配置详解:
MyBatis Generator 详解

一:下载 MyBatis Generator Tool

       下载地址:https://pan.baidu.com/s/1-QvO3kqXHHNg0SDnp3tkwA

二:解读generator.xml,根据注释修改配置。

一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】
Mybatis Generator最完整配置详解:
MyBatis Generator 详解

我这里以MsSql(SqlServer)为例~

①:准备数据库驱动包

<classPathEntry location="D:sqljdbc4R2.jar" />

②:修改数据库链接,这里写了三种常用的数据库链接方式(Oracle、MySql、MsSql)

③:指定实体、映射文件和Dao生成的存放位置

④:填写你需要生成的表

       tableName :数据库的表名;domainObjectName :生成的实体类类名

第三步:执行生成语句

①:打开命令窗口   CMD,进入 MyBatis Generator Tool 所在文件夹

一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】
Mybatis Generator最完整配置详解:
MyBatis Generator 详解

②:执行命令

生成语句:java -jar mybatis-generator-core-1.3.2.jar -configfile generator.xml -overwrite

一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】
Mybatis Generator最完整配置详解:
MyBatis Generator 详解

MyBatis Generator finished successfully. ---- 出现这句话的时候,文件就生成好了~

一:MyBatis Generator 【SpringMvc+Spring+MyBatis+Maven整合学习笔记】
Mybatis Generator最完整配置详解:
MyBatis Generator 详解

在这里MyBatis自动生成工具就讲完了~~如果想知道完整的注解,可以看下面两位博主分享的~~

作者:叩丁狼教育
链接:http://www.jianshu.com/p/e09d2370b796
來源:简书

MyBatis Generator 详解

作者:isea533
链接:https://blog.csdn.net/isea533/article/details/42102297
來源:CSDN