1.pom.xml文件中 生成依赖
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>Generate MyBatis Artifacts</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- generator 工具配置文件的位置 -->
<configurationFile>src/main/resources/generatorConfig.xml</configurationFile>
<verbose>true</verbose>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.mybatis.generator/mybatis-generator-core -->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.5</version>
</dependency> </dependencies>
</plugin>
2.编写配置文件  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>
<properties resource="application.properties"></properties>
<context id="DB2Tables" targetRuntime="MyBatis3">
<!--去掉注释-->
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--需要配置数据库连接-->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://47.xx.xx.xx:3306/wx_review?characterEncoding=utf-8"
userId="root"
password="W_angxx">
</jdbcConnection>
<javaTypeResolver >
<property name="forceBigDecimals" value="false" />
</javaTypeResolver> <!--指定entity生成的位置-->
<javaModelGenerator targetPackage="cn.unicom.com.domain" targetProject="./src/main/java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator> <!--sql映射文件生成的位置 mapper.xml-->
<sqlMapGenerator targetPackage="mapper" targetProject="./src/main/resources">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator> <!--指定DaoMapper生成的位置 mapper.java-->
<javaClientGenerator type="XMLMAPPER" targetPackage="cn.unicom.com.mapper" targetProject="./src/main/java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator> <!--table是指定每个表的生成策略-->
<!--<table tableName="department" domainObjectName="Department"></table>-->
<!--<table tableName="group_teacher_rel" domainObjectName="Group_teacher_rel"></table>-->
<!--<table tableName="groups" domainObjectName="Groups"></table>-->
<!--<table tableName="specialty" domainObjectName="Specialty"></table>-->
<!--<table tableName="student" domainObjectName="Student"></table>-->
<!--<table tableName="teacher" domainObjectName="Teacher"></table>-->
<!-- <table tableName="video" domainObjectName="Video" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="video_order" domainObjectName="ViderOrder" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="episode" domainObjectName="Episode" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="comment" domainObjectName="Comment" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="chapter" domainObjectName="Chapter" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>-->
<table tableName="video_order" domainObjectName="ViderOrder" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table> </context>
</generatorConfiguration>
3.执行。

												

最新文章

  1. [NOIP2013]华容道
  2. SLAM前端技术选择思考
  3. 105 董婷婷 第一次Sprint总结
  4. Windows服务定时执行方式
  5. InLineHookSSDT
  6. ssh,telnet远程AIX以及数据传输问题
  7. AndroidHttp通信 HTTP Client与HttpURLConnection的区别
  8. Java反射的理解
  9. 从零开始,在windows上用nodejs搭建一个静态文件服务器
  10. STL 之 queue、priority_queue 源代码剖析
  11. hdu 3695 Computer Virus on Planet Pandora(AC自己主动机)
  12. 我的IT开源之路
  13. python 基础之字符编码和文件处理
  14. redis和spring集成
  15. 二 Array 数组常用操作方法
  16. Python学习总结 11 使用tempest测试OpenStack
  17. docker学习-常用命令1
  18. 【移动端】移动端字体单位font-size选择px还是rem
  19. Linux mail 邮件发送
  20. 【转】MySQL中information_schema是什么

热门文章

  1. Python 针对Excel操作
  2. 【Log4J】
  3. 一个用beego写的API项目
  4. 03_Hive的交互方式
  5. Matlab---绘图中坐标系显示设置
  6. 简单的jquery进度条插件LineProgressbar.js,myProgress.js
  7. CentOS 6 自定义单实例 二进制方式 安装mariadb-5.5.59
  8. flutter 项目中打印原生安卓的log信息
  9. mysql数据库系统学习(一)---一条SQL查询语句是如何执行的?
  10. JS 中获取服务器时间的注意点