zoukankan      html  css  js  c++  java
  • Mybatis的逆向工程,MySQL8的数据库,8.0.11驱动的逆向工程的坑的解决方法

    如果您使用的是Connector / J的8.x版,您可能会注意到生成器尝试为MySql信息模式(sys,information_schema,performance_schema等)中的表生成代码。这可能不是您想要的! 要禁用此行为,请将属性“nullCatalogMeansCurrent = true”添加到JDBC

    下面颜色标准的就是8.0.11驱动容易漏掉的,

    driverClass="com.mysql.cj.jdbc.Driver"

    connectionURL="jdbc:mysql://localhost:3306/logistics?useUnicode=true&characterEncoding=utf8

    &serverTimezone=GMT&nullCatalogMeansCurrent = true" 

    <?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="context1">
       <!-- 注释构建 -->
        <commentGenerator>
           <!-- 去掉所有的注释 -->
         <property name="suppressAllComments" value="true"/>
         <property name="suppressDate" value="true"/>
        </commentGenerator>
        
        <!-- 数据库四要素 -->
        <jdbcConnection connectionURL="jdbc:mysql://localhost:3306/logistics?useUnicode=true&amp;characterEncoding=utf-8&amp;serverTimezone=GMT&amp;nullCatalogMeansCurrent = true" driverClass="com.mysql.cj.jdbc.Driver" password="gzsxt" userId="root" />
    
       
        <!-- 实体类  -->
        <javaModelGenerator targetPackage="cn.sxt.logistic.pojo" targetProject="mybatis-generator/src" />
        <!-- 映射文件 -->
        <sqlMapGenerator targetPackage="cn.sxt.logistic.mapper" targetProject="mybatis-generator/src" />
        
        <!-- ANNOTATEDMAPPER
         XMLMAPPER
         -->
        
        <!-- 操作接口 -->
        <javaClientGenerator  targetPackage="cn.sxt.logistic.mapper" targetProject="mybatis-generator/src" type="XMLMAPPER" />
        <table  tableName="user"  domainObjectName="User"  enableCountByExample="true" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table>
        <table  tableName="role" domainObjectName="Role" enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table>
        <table  tableName="permission"  domainObjectName="Permission" enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="true" enableUpdateByExample="false"></table>
      </context>
    </generatorConfiguration>
  • 相关阅读:
    【491】概率论与数理统计——宋浩 笔记
    【491】安装 keras_contrib 高级网络实现模块详细方法
    【490】Stanford POS tagger 实现及相关含义
    git中submodule子模块的添加、使用和删除
    IOS开发之----NSError错误信息
    一个基于SpringBoot + IView 的单体架构管理系统
    GPS经纬度坐标WGS84到东北天坐标系ENU的转换
    ubuntu循环登录问题解决
    固件错误Possible missing firmware解决办法
    crc校验
  • 原文地址:https://www.cnblogs.com/406070989senlin/p/11198788.html
Copyright © 2011-2022 走看看