1. 在build的plugin节点下配置

    <plugin><groupId>org.mybatis.generator</groupId><artifactId>mybatis-generator-maven-plugin</artifactId><version>1.3.2</version><dependencies><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.22</version></dependency></dependencies><configuration><verbose>true</verbose><overwrite>true</overwrite></configuration></plugin>
    

  2. 在resoures资源文件下创建generatorConfig.xml文件 并编写内容

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"><generatorConfiguration><context id="mysqlgenerator" targetRuntime="MyBatis3"><!--配置数据库--><jdbcConnection driverClass="com.mysql.jdbc.Driver"connectionURL="jdbc:mysql://localhost:3306/nfc_database"userId="root"password="8686886" /><!--配置model生成的位置--><javaModelGenerator targetPackage="com.wilson.nfc.model" targetProject="src/main/java"/><!--配置xml生成的位置--><sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources"/><!--配置mapper生成的位置--><javaClientGenerator type="XMLMAPPER" targetPackage="com.wilson.nfc.mapper" targetProject="src/main/java"/><!--配置需要生成的表--><table tableName="nfc_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table><table tableName="nfc_shipping" domainObjectName="Shipping" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table><!--<table tableName="nfc_product" domainObjectName="Product" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_pay_info" domainObjectName="PayInfo" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_order_item" domainObjectName="OrderItem" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_order" domainObjectName="Order" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_category" domainObjectName="Category" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_cart" domainObjectName="Cart" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--><!--<table tableName="nfc_user"/>--><!--<table tableName="city" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>--></context>
    
  3. 在maven工具类进行运行进行生成

—————– 关注公众号获取更多内容————

springboot配置mybatis.generator相关推荐

  1. Springboot—mysql+mybatis+generator插件

    1.idea-generatorConfig.xml <?xml version="1.0" encoding="UTF-8"?> <!DOC ...

  2. Springboot整合Mybatis generator

    Springboot整合Mybatis generator 1. 新建Springboot工程 step 1 step 2 step 3 2.引入Mybatis generator插件 3.编写Myb ...

  3. SpringBoot配置Mybatis多数据源

    SpringBoot配置Mybatis多数据源 配置多数据源可以将springboot自动装配的数据源给关闭. 1.添加pom文件,只需要添加数据源驱动和mybatis包 <dependency ...

  4. SpringBoot的MyBatis generator 注解方式和xml方式 (四)

    两种形式: XML方式 type="XMLMAPPER" 注解方式 type="ANNOTATEDMAPPER" 1.1 pom.xml里添加maven插件 & ...

  5. springboot集成mybatis+Generator代码生成

    首先主备个数据库和user表 建表语句如下,当然你也可以用自己的 CREATE TABLE `user` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` va ...

  6. springboot配置mybatis逆向工程

    mybatis逆向工程很早之前有用过,但是一直没有整理使用步骤,今天来回顾下在idea下springboot中整合mybatis逆向工程的实现步骤 什么是逆向工程? 所谓mybatis逆向工程,就是m ...

  7. SpringBoot配置mybatis多数据源(包含单数据源)最终解决方案,带源码

    贴上我的github: https://github.com/mx342/testSpringbootMutipartDatasource.git 具体项目文件请查看github上面的项目 # tes ...

  8. SpringBoot配置Mybatis打印SQL

    两种方式,一种基于SpringBoot自动装配通过yml文件直接配置,另一种是配置在mybatis的全局配置文件中. 但是两种方式不能同时配置,在SpringBoot V1.5.9以上版本惠报错: P ...

  9. springboot配置mybatis redis缓存

    一.概述 首先来了解下mybatis 缓存,mybatis缓存分为一级缓存和二级缓存.一级缓存是默认开启的,无需其他配置操作,二级缓存则需要手动设置开启. 一级缓存原理: Mybatis的一级缓存是指 ...

  10. 图解 IDEA 中 springboot 项目 MyBatis Generator 逆向生成实体类及 mapper 配置文件

    前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家.点击跳转到教程. 一.准备工作: 1. 新建一个 配置文件:generatorConfig.xml . <?xm ...

最新文章

  1. leetcode算法题--整数拆分
  2. linux磁盘和文件系统管理
  3. IT职场健康杀手与应对宝典 (虽然是IT职场,可是对于常上网的ggmm也是很有用的)...
  4. 免责协议怎么写_员工辞职时,HR得让他这样写离职申请!
  5. vb代码转换为java_有人可以解释如何使用JACOB将VB代码转换为Java吗?
  6. 计算机配件模拟,模拟计算机是指什么
  7. Android蓝牙服务
  8. IOS 公共类-数字处理
  9. linux之tcpdump抓包工具
  10. 中标麒麟系统安装步骤
  11. AirPlay to Mac 如何工作以及使用它需要什么
  12. 获取本地视频url的方法
  13. MATLAB struct函数(结构体数组)
  14. “弹出USB大容量存储设备时出问题”的解决方法
  15. 第六章第三十题(游戏:双骰子赌博)(Game: craps)
  16. 各种梯度算法总结 + Total Variation
  17. 浅谈建站经验之网站建设的流程与步骤
  18. 2016全国大学生信息安全竞赛(Misc)
  19. 流程图软件lauto_流程图软件(Iauto)
  20. python中 r'', b'', u'', f'' 的含义

热门文章

  1. line 1 appears to contain embedded nulls
  2. Objectdock stacks docklet 无法启动程序快捷方式
  3. Python教程:利用百度API进行批量图片OCR识别
  4. 【转】Windows批处理学习(一)——MS-DOS命令
  5. 《Python安全攻防:渗透测试实战指南》配套技术讲解
  6. 苹果ipad基本使用方法,苹果ipad的使用方法
  7. 什么是深浅拷贝?如何实现深浅拷贝
  8. Elasticsearch语法大全
  9. 单片机c语言课后题答案,单片机原理及应用(C语言版)习题答案.doc
  10. 2020-11-19学习记录(keer‘s bug与gdb bug)