• mybatis自动生成代码配置文件


     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!DOCTYPE generatorConfiguration
     3   PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
     4   "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
     5 
     6 <generatorConfiguration>
     7     <!-- classPathEntry:数据库的JDBC驱动 -->
     8     <classPathEntry location="WebContent/WEB-INF/lib/postgresql-8.3-607.jdbc4.jar" />
     9     <context id="DB2Tables" targetRuntime="MyBatis3">
    10         <!-- 去除自动生成的注释 -->
    11         <!--
    12             <commentGenerator> <property name="suppressDate" value="true" />
    13             </commentGenerator>
    14         -->
    15         <plugin type="org.mybatis.generator.plugins.RenameExampleClassPlugin">
    16             <property name="searchString" value="Example$" />
    17             <property name="replaceString" value="QueryBean" />
    18         </plugin>
    19         <jdbcConnection driverClass="org.postgresql.Driver"
    20             connectionURL="jdbc:postgresql://xxxxxx/xxxxx" userId="postgres"
    21             password="xxxxx">
    22         </jdbcConnection>
    23 
    24         <javaTypeResolver>
    25             <property name="forceBigDecimals" value="false" />
    26         </javaTypeResolver>
    27         <!-- targetProject:自动生成代码的位置 -->
    28         <javaModelGenerator targetPackage="entity"
    29             targetProject="./src/main">
    30             <property name="enableSubPackages" value="false" />
    31             <property name="trimStrings" value="true" />
    32         </javaModelGenerator>
    33 
    34         <sqlMapGenerator targetPackage="dao" targetProject="./src/main">
    35             <property name="enableSubPackages" value="false" />
    36         </sqlMapGenerator>
    37 
    38         <javaClientGenerator type="XMLMAPPER"
    39             targetPackage="dao" targetProject="./src/main">
    40             <property name="enableSubPackages" value="false" />
    41         </javaClientGenerator>
    42         <!-- tableName:用于自动生成代码的数据库表;domainObjectName:对应于数据库表的javaBean类名 -->
    43         <table tableName="xxxx" schema="xxxx"
    44             domainObjectName="xxxx" />
    45     </context>
    46 </generatorConfiguration>

    然后在Run Configuration里面找到Shell Runner

    在Argument里面输入 -configfile ./xxx/config.xml -overwrite

  • 相关阅读:
    layui的form.val无法动态渲染赋值表单问题解决方法
    Android studio引入三方sdk运行时报错Cause: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26)
    tp6通过闭包方式连表查询的问题
    android中简单便捷使用GreenDao本地数据库及采坑之路
    Java多线程(一)
    Java集合
    JAVA IO/NIO
    JVM类加载机制
    JVM垃圾回收与算法
    JVM内存模型
  • 原文地址:https://www.cnblogs.com/xiaoskery/p/3052152.html
Copyright © 2020-2023  润新知