zoukankan      html  css  js  c++  java
  • 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

  • 相关阅读:
    CodeForces
    CodeForces
    sort自定义cmp函数
    The 2015 China Collegiate Programming Contest Sudoku
    G
    docker
    在容器内获取Pod信息(Downward API)
    k8s Pod定义详解
    Pod和容器的生命周期管理
    GoAccess日志分析工具
  • 原文地址:https://www.cnblogs.com/xiaoskery/p/3052152.html
Copyright © 2011-2022 走看看