开发环境搭建之springboot+tk.mybatis整合使用逆向工程
一,引入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整合使用逆向工程的更多相关文章
- 传智播客C/C++各种开发环境搭建视频工具文档免费教程
传智播客作为中国IT培训的领军品牌,一直把握技术趋势,给大家带来最新的技术分享!传智播客C/C++主流开发环境免费分享视频文档中,就有写一个helloworld程序的示范.火速前来下载吧 所谓&quo ...
- 【转载】Maven+druid+MyBatis+Spring+Oracle+Dubbo开发环境搭建
原地址:http://blog.csdn.net/wp1603710463/article/details/48247817#t16 Maven+druid+MyBatis+spring+Oracle ...
- mybatis实战教程(mybatis in action)之一:开发环境搭建
mybatis 的开发环境搭建,选择: eclipse j2ee 版本,mysql 5.1 ,jdk 1.7,mybatis3.2.0.jar包.这些软件工具均可以到各自的官方网站上下载. 首先建立一 ...
- 1.mybatis实战教程mybatis in action之一开发环境搭建
转自:https://www.cnblogs.com/shanheyongmu/p/5652471.html 什么是mybatis MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框 ...
- MyBatis实例教程--开发环境搭建
MyBatis实例教程--开发环境搭建 准备工作: 1.mybatis 的开发环境搭建,选择: eclipse j2ee 版本,mysql 5.1 ,jdk 1.7,mybatis3.2.0.jar包 ...
- mybatis:开发环境搭建--增删改查--多表联合查询(多对一)
什么是mybatisMyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索.MyBatis使用简单的XML或 ...
- Mybatis学习(1)开发环境搭建
什么是mybatis MyBatis是支持普通SQL查询,存储过程和高级映射的优秀持久层框架.MyBatis消除了几乎所有的JDBC代码和参数的手工设置以及结果集的检索.MyBatis使用简单的XML ...
- Spring MVC 环境搭建(maven+SpringMVC+mybatis+Freemarker)
Spring MVC 环境搭建(maven+SpringMVC+mybatis+Freemarker) 一.准备工作 1.Eclipse Java EE IDE(4.4.1) 2.JDK 3.Tomc ...
- 30分钟带你了解Springboot与Mybatis整合最佳实践
前言:Springboot怎么使用想必也无需我多言,Mybitas作为实用性极强的ORM框架也深受广大开发人员喜爱,有关如何整合它们的文章在网络上随处可见.但是今天我会从实战的角度出发,谈谈我对二者结 ...
随机推荐
- 学习 Git Rebase
有问题为什么不问问神奇的 man 呢? rebase 也算是我比较常用的一个指令了,但是很长时间以来,对这个指令的认识还是不够深刻,于是就找了个时间认真地读了一下 git rebase 的文档.这份文 ...
- hive 字符串截取
语法 :substr(字段,starindex,len) 下标从 1 开始 测试 ,) from siebel_cx_order limit ; -- -- -- -- -- -- -- -- -- ...
- 前端与算法 leetcode 28.实现 strStr()
# 前端与算法 leetcode 28.实现 strStr() 题目描述 28.移除元素 概要 这道题的意义是实现一个api,不是调api,尽管很多时候api的速度比我们写的快(今天这个我们可以做到和 ...
- 64位linux安装了32位jdk8报错怎么办-bash:/usr/local/jdk1.8/jdk1.8.0_181/bin/java:/lib/ld-linux.so.2:badELFinterpreter:Nosuch
-bash:/usr/local/jdk1.8/jdk1.8.0_181/bin/java:/lib/ld-linux.so.2:badELFinterpreter:Nosuch https://bl ...
- [转帖]java中的for循环
java中的for循环 https://baijiahao.baidu.com/s?id=1621622990642364099&wfr=spider&for=pc 发现自己连 for ...
- C++ Primer中文第四版
C++ Primer中文第四版 在简书上发现有挂羊头卖狗肉的,发的plus,而且压缩包还得付钱获取密码,我直接去github搜到了第四版,在此分享一下. 格式:pdf 书签目录:有 下载地址: ...
- Python全栈开发相关课程
Python全栈开发 Python入门 Python安装 Pycharm安装.激活.使用 Python基础 Python语法 Python数据类型 Python进阶 面向对象 网络编程 并发编程 数据 ...
- jQuery格式化显示json数据
一.概述 JSONView 在gitlab上面,有一个jQuery JSONView插件,地址为:https://github.com/yesmeck/jquery-jsonview demo地址:h ...
- 【模板】bitset
Bitset常用操作: bitset<size> s; //定义一个大小为size的bitset s.count(); //统计s中1的个数 s.set(); //将s的所有位变成1 s. ...
- node-red inject节点 debug节点 switch节点
inject节点: https://blog.csdn.net/geek_monkey/article/details/80737818 debug节点: https://blog.csdn.net/ ...