• generatorConfig.xml自动生成实体类,dao和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>
    <classPathEntry location="D:Toolsmysql-connector-java-5.1.48mysql-connector-java-5.1.48.jar" />
    <context id="OracleTables" targetRuntime="MyBatis3">
    <commentGenerator>
    <property name="suppressAllComments" value="true" />
    </commentGenerator>
    <!--数据库连接信息-->
    <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/ecsb_dev"
    userId="root" password="123456">
    </jdbcConnection>
    <javaTypeResolver>
    <property name="forceBigDecimals" value="false" />
    </javaTypeResolver>
    <javaModelGenerator targetPackage="com.crt.openapi.modules.common.domain.entity" targetProject="ecsb-apidomain">
    <property name="enableSubPackages" value="true" />
    <property name="trimStrings" value="true" />
    </javaModelGenerator>
    <sqlMapGenerator targetPackage="com.crt.openapi.modules.common.domain.dao" targetProject="ecsb-apidomain">
    <property name="enableSubPackages" value="true" />
    </sqlMapGenerator>
    <javaClientGenerator type="XMLMAPPER" targetPackage="com.crt.openapi.modules.common.domain.dao" targetProject="ecsb-apidomain">
    <property name="enableSubPackages" value="false" />
    </javaClientGenerator>
    <table tableName="api_menu_resource" domainObjectName="ApiMenuResource"
    enableCountByExample="true" enableDeleteByExample="true"
    enableDeleteByPrimaryKey="true" enableInsert="true"
    enableSelectByExample="true" enableSelectByPrimaryKey="true"
    enableUpdateByExample="true" enableUpdateByPrimaryKey="true" >
    </table>
    </context>
    </generatorConfiguration>

    <!--代码生成器依赖 -->
    <build>
    		<plugins>
    			 <plugin>
                    <groupId>org.mybatis.generator</groupId>
                    <artifactId>mybatis-generator-maven-plugin</artifactId>
                    <version>1.3.2</version>
                    <configuration>
                        <verbose>true</verbose>
                        <overwrite>true</overwrite>
                    </configuration>
                </plugin>
    		</plugins>
    	</build>
    

      




    eclipse插件下载地址: https://i.cnblogs.com/Files.aspx
  • 相关阅读:
    重载小于号
    无聊的会议
    程序内存和时间
    对拍
    读入和输出优化
    codevs 3269 混合背包
    清北第三套题
    codevs 2188 最长上升子序列
    清北第二套题
    [COGS896] 圈奶牛
  • 原文地址:https://www.cnblogs.com/hikoukay/p/11651980.html
Copyright © 2020-2023  润新知