一,引入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. JobStorage.Current property value has not been initialized. You must set it before using Hangfire Client or Server API.

    JobStorage.Current property value has not been initialized. You must set it before using Hangfire Cl ...

  2. rxjs debounceTime减少搜索的频率

    debounceTime用来降低事件的触发频率 ,接收以毫秒为单位的参数 它所做的操作是,在一定时间范围内不管产生了多少事件,它只放第一个过去,剩下的都将舍弃 html: <div class= ...

  3. mybatis异常集锦

    [Mybatis]报错:Malformed OGNL expression: name!= null and name != ' ' [Mybatis]报错:Malformed OGNL expres ...

  4. redis单机多节点集群

    # ##安装Redis redis安装参考 https://www.cnblogs.com/renxixao/p/11442770.html Reids安装包里有个集群工具,要复制到/usr/loca ...

  5. java中对对象进行判空的操作--简洁编码

    java中对对象进行判空的操作 首先来看一下工具StringUtils的判断方法: 一种是org.apache.commons.lang3包下的: 另一种是org.springframework.ut ...

  6. Jmeter相关参数

    一.线程组 线程组主要包含三个参数:线程数.准备时长(Ramp-Up Period(in seconds)).循环次数. 线程数:虚拟用户数.一个虚拟用户占用一个进程或线程.设置多少虚拟用户数在这里也 ...

  7. ubuntu安装shadow socks-qt5

    Ubuntu16安装shadow socks-qt5 在Ubuntu下也是有GUI客户端,怎么安装请看下面: 首先,针对Ubuntu16的版本可以直接这么安装: .$ sudo add-apt-rep ...

  8. python_并发与通信

    独立的进程内存空间与共享的服务器进程空间 知识点一: 进程间通信的限制 进程是独立的,互不干扰的独立内存空间我们想不能修改变量但是,深层次问题是,这个进程与那个进程完全失去了联系 import mul ...

  9. Entity framework Core 数据库迁移

    本文转自https://www.cnblogs.com/zmaiwxl/p/9454177.html 初始化数据库 1.添加初始迁移 Add-Migration init 向“迁移”目录下的项目添加以 ...

  10. spring加载多个配置文件如何配置

    为应用指定多个配置文件: 多个配置文件的关系: 并列 包含 并列关系 即有多个配置文件,需要同时加载这多个配置文件: 可以使用可变参数,数组和统配符进行加载: 可变参数 String config1 ...