zoukankan      html  css  js  c++  java
  • mybatis generator 自动生成代码

    generatorConfig.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>
        <!-- oracle lib location -->
        <classPathEntry location="D:
    epositorymysqlmysql-connector-java5.1.38mysql-connector-java-5.1.38.jar" />
        <context id="DB2Tables" targetRuntime="MyBatis3">
            <commentGenerator>
                <property name="suppressAllComments" value="true" />
            </commentGenerator>
            <jdbcConnection driverClass="com.mysql.jdbc.Driver"
                connectionURL="jdbc:mysql://127.0.0.1:3306/test" userId="root"
                password="123456">
            </jdbcConnection>
            <javaTypeResolver>
                <property name="forceBigDecimals" value="false" />
            </javaTypeResolver>
            
            
            <!-- model package and location -->
            <javaModelGenerator targetPackage="com.saas.basic.model" targetProject="basic-datasrcmainjava">
                <property name="enableSubPackages" value="true" />
                <property name="trimStrings" value="true" />
            </javaModelGenerator>
            <!-- mapping package and location 此处的targetPackage的值是resource下的文件件,即xml存放位置-->
            <sqlMapGenerator targetPackage="mapper" targetProject="basic-datasrcmain
    esources">
                <property name="enableSubPackages" value="true" />
            </sqlMapGenerator>
            <!-- dao package and location -->
            <javaClientGenerator type="XMLMAPPER" targetPackage="com.saas.basic.mapper" targetProject="basic-datasrcmainjava">
                <property name="enableSubPackages" value="true" />
            </javaClientGenerator>
            
            
            <!-- <table tableName="fault_code_info" domainObjectName="FaultCodeInfo"
                enableCountByExample="false" enableUpdateByExample="false"
                enableDeleteByExample="false" enableSelectByExample="false"
                selectByExampleQueryId="false" /> -->
                
              <!-- <table tableName="fault_handling_mode" domainObjectName="FaultHandlingMode"
                 enableCountByExample="false" enableUpdateByExample="false"
                 enableDeleteByExample="false" enableSelectByExample="false"
                 selectByExampleQueryId="false" /> -->
            <table tableName="device_type" domainObjectName="AAAA"
                 enableCountByExample="false" enableUpdateByExample="false"
                 enableDeleteByExample="false" enableSelectByExample="false"
                 selectByExampleQueryId="false" />
                
        </context>
    </generatorConfiguration>
  • 相关阅读:
    ruby 中super和super()的区别
    SeleniumWebdriver系列教程(2)————浏览器的简单操作
    ruby设计模式之合成模式1————基本的合成模式
    ruby中::究竟代表什么?
    手工测试用例就是自动化测试脚本——使用ruby 1.9新特性进行自动化脚本的编写
    如何使用bluecloth
    如何使用ruby去实例化1个autoit对象
    Ruby设计模式之策略模式二————更ruby些的策略模式
    SeleniumWebdriver系列教程(1)————快速开始
    Seleniumwebdriver系列教程(3)————如何执行一段js脚本
  • 原文地址:https://www.cnblogs.com/shihaiming/p/11684863.html
Copyright © 2011-2022 走看看