一,引入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>
<context id="Mysql" targetRuntime="MyBatis3Simple" defaultModelType="flat">
<property name="javaFileEncoding" value="UTF-8"/>
<plugin type="tk.mybatis.mapper.generator.MapperPlugin">
<property name="mappers" value="com.example.ordersystem.common.mapper.SchoolBaseMapper"/>
</plugin>
<!-- 生成注释配置 -->
<commentGenerator>
<!-- 是否取消注释 -->
<property name="suppressAllComments" value="false"/>
<!-- 数据库注释支持 -->
<property name="addRemarkComments" value="false"/>
<!-- 时间格式设置 -->
<property name="dateFormat" value="yyyy-MM-dd HH:mm:ss"/>
</commentGenerator> <jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://ip地址:3306/order_system?serverTimezone=GMT%2B8"
userId="root"
password="root">
</jdbcConnection> <javaModelGenerator targetPackage="com.example.ordersystem.common.entity" targetProject="src/main/java"/> <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/> <javaClientGenerator targetPackage="com.example.ordersystem.common.mapper"
targetProject="src/main/java" type="XMLMAPPER"/> <!-- <table tableName="t%" >
<generatedKey column="id" sqlStatement="MySql" identity="true" />
<domainObjectRenamingRule searchString="^T" replaceString="" />
<columnRenamingRule searchString="^T" replaceString=""/>
</table>-->
<table tableName="order_detail">
<generatedKey column="detail_id" sqlStatement="MySql" identity="true"/>
<domainObjectRenamingRule searchString="^T" replaceString=""/>
<columnRenamingRule searchString="^T" replaceString=""/>
</table>
<table tableName="order_master">
<generatedKey column="order_id" sqlStatement="MySql" identity="true"/>
<domainObjectRenamingRule searchString="^T" replaceString=""/>
<columnRenamingRule searchString="^T" replaceString=""/>
</table>
<table tableName="product_category">
<generatedKey column="category_id" sqlStatement="MySql" identity="true"/>
<domainObjectRenamingRule searchString="^T" replaceString=""/>
<columnRenamingRule searchString="^T" replaceString=""/>
</table>
<table tableName="product_info">
<generatedKey column="product_id" sqlStatement="MySql" identity="true"/>
<domainObjectRenamingRule searchString="^T" replaceString=""/>
<columnRenamingRule searchString="^T" replaceString=""/>
</table>
</context>
</generatorConfiguration>

这个配置文件中可以去除添加去除创建的T

在pom文件中引入插件:

<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version> 1.36</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/generator/generatorConfiglocal.xml
</configurationFile>
<overwrite>true</overwrite>
<verbose>true</verbose>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>runtime</version>
</dependency>
<dependency>
<groupId>tk.mybatis</groupId>
<artifactId>mapper</artifactId>
<version>3.4.6</version>
</dependency>
</dependencies>
</plugin>

然后再使用maven上个的插件,就可以直接生成dao,mapper,mapper.xml文件

开发环境搭建之springboot+tk.mybatis整合使用逆向工程的更多相关文章

  1. 传智播客C/C++各种开发环境搭建视频工具文档免费教程

    传智播客作为中国IT培训的领军品牌,一直把握技术趋势,给大家带来最新的技术分享!传智播客C/C++主流开发环境免费分享视频文档中,就有写一个helloworld程序的示范.火速前来下载吧 所谓&quo ...

  2. 【转载】Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建

    原地址:http://blog.csdn.net/wp1603710463/article/details/48247817#t16 Maven+druid+MyBatis+spring+Oracle ...

  3. mybatis实战教程(mybatis in action)之一:开发环境搭建

    mybatis 的开发环境搭建,选择: eclipse j2ee 版本,mysql 5.1 ,jdk 1.7,mybatis3.2.0.jar包.这些软件工具均可以到各自的官方网站上下载. 首先建立一 ...

  4. 1.mybatis实战教程mybatis in action之一开发环境搭建

    转自:https://www.cnblogs.com/shanheyongmu/p/5652471.html 什么是mybatis MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框 ...

  5. MyBatis实例教程--开发环境搭建

    MyBatis实例教程--开发环境搭建 准备工作: 1.mybatis 的开发环境搭建,选择: eclipse j2ee 版本,mysql 5.1 ,jdk 1.7,mybatis3.2.0.jar包 ...

  6. mybatis:开发环境搭建--增删改查--多表联合查询(多对一)

    什么是mybatisMyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索.MyBatis使用简单的XML或 ...

  7. Mybatis学习(1)开发环境搭建

    什么是mybatis MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索.MyBatis使用简单的XML ...

  8. Spring MVC 环境搭建(maven+SpringMVC+mybatis+Freemarker)

    Spring MVC 环境搭建(maven+SpringMVC+mybatis+Freemarker) 一.准备工作 1.Eclipse Java EE IDE(4.4.1) 2.JDK 3.Tomc ...

  9. 30分钟带你了解Springboot与Mybatis整合最佳实践

    前言:Springboot怎么使用想必也无需我多言,Mybitas作为实用性极强的ORM框架也深受广大开发人员喜爱,有关如何整合它们的文章在网络上随处可见.但是今天我会从实战的角度出发,谈谈我对二者结 ...

随机推荐

  1. iOS——学习网址收集

    1 一个比系统自带的终端好用的软件:http://www.iterm2.com 2 学习和遇到技术问题可以去的网站: CocoaChina      http://developer.cocoachi ...

  2. c# socket 心跳 重连

    /// <summary> /// 检查一个Socket是否可连接 /// </summary> /// <param name="socket"&g ...

  3. qsort与sort

    快排是我们平常敲代码和比赛的时候     经常使用到的方法 qsort是函数库中自带的函数    这是一个标准的快排函数 而sort比qsort更是好用    sort对于不同大小的数组   会使用不 ...

  4. Java开发笔记(一百四十二)JavaFX的对话框

    JavaFX的对话框主要分为提示对话框和文件对话框两类,其中提示对话框又分作消息对话框.警告对话框.错误对话框.确认对话框四种.这四种对话框都使用Alert控件表达,并通过对话框类型加以区分,例如Al ...

  5. SQL语句报错:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near

    报错如图: 最开始其实我的列名tname和tsubject分别叫name和subject,后来看到网上有说这个报错可能是数据库建表的时候使用了mysql的关键词,我就只把name改了.后来还是这个问题 ...

  6. emmet html缩写

    HTML缩写 Emmet使用类似于CSS选择器的语法来描述元素在生成的树中的位置和元素的属性. 元素 您可以使用元素的名字,如div或p以生成 HTML标签. Emmet没有一组预定义的可用标签名称, ...

  7. KEPServerEX 6 配置连接 Allen-Bradley MicroLogix 1400

    =============================================== 2019/7/28_第1次修改                       ccb_warlock == ...

  8. SessionChange

    protected override void OnSessionChange(SessionChangeDescription changeDescription) { System.IO.File ...

  9. txt文件每行内容与图片文件名字组合,输出txt格式

    import os dir_list = os.listdir('C:\\Users\\10107472\\Desktop\\practice\\JPEGImages')i=0f1=open('C:\ ...

  10. spring中bean的作用域属性singleton与prototype的区别

    1.singleton 当一个bean的作用域设置为singleton, 那么Spring IOC容器中只会存在一个共享的bean实例,并且所有对bean的请求,只要id与该bean定义相匹配,则只会 ...