<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # MyBatis Generator XML 配置參考 最常見的用例中,代碼生成器(MBG)是由一個XML配置文件驅動。配置文件告訴MBG: * 如何連接到數據庫 * 生成什么對象,以及如何生成它們 * 那些表生成對象 下面是一個MBG配置文件的例子。查閱每個元素單獨的頁面查看更多有關元素的更多信息和屬性值。 ``` <?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="/Program Files/IBM/SQLLIB/java/db2java.zip" /> <context id="DB2Tables" targetRuntime="MyBatis3"> <jdbcConnection driverClass="COM.ibm.db2.jdbc.app.DB2Driver" connectionURL="jdbc:db2:TEST" userId="db2admin" password="db2admin"> </jdbcConnection> <javaTypeResolver > <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <javaModelGenerator targetPackage="test.model" targetProject="\MBGTestProject\src"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <sqlMapGenerator targetPackage="test.xml" targetProject="\MBGTestProject\src"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <javaClientGenerator type="XMLMAPPER" targetPackage="test.dao" targetProject="\MBGTestProject\src"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <table schema="DB2ADMIN" tableName="ALLTYPES" domainObjectName="Customer" > <property name="useActualColumnNames" value="true"/> <generatedKey column="ID" sqlStatement="DB2" identity="true" /> <columnOverride column="DATE_FIELD" property="startDate" /> <ignoreColumn column="FRED" /> <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" /> </table> </context> </generatorConfiguration> ``` 有關此文件的重要說明: * 該文件指定舊式DB2 CLI驅動程序將用于連接到數據庫,并指定在何處可以找到驅動程序。 * Java類型解析器不應該強制型對象字段BigDecimal的使用,這意味著整數類型(短、整型、長等)如果可能的話將被取代。 此功能是為了使數據庫DECIMAL和NUMERIC列容易處理。 * Java模型生成器應該使用子包。 這意味著在這種情況下生成的模型對象將被放置在名為 `test.model.db2admin` 的包中(因為表在 DB2ADMIN schema中)。 如果 `enableSubPackages` 屬性設置為 `false`, 那么包名將會是 `test.model`。 Java模型生成器也應該對字符串進行trim操作。 這意味著任何字符串屬性的setter方法將調用trim方法 - 如果您的數據庫可能會在字符末尾返回空白符,這是非常有用的。 * SQL映射生成器將使用子包。這意味著這種情況下生成的XML文件將被放置在名為 `test.xml.db2admin` 的包中(因為表在 DB2ADMIN schema中)。 如果 `enableSubPackages` 屬性設置為 `false`, 那么包名將會是 `test.xml`。 * DAO生成器將使用子包。這意味著這種情況下生成的DAO類都會被放置在名為 `test.dao.db2admin` 的包中(因為表在 DB2ADMIN schema中)。 如果 `enableSubPackages` 屬性設置為 `false`, 那么包名將會是 `test.dao`。 DAO生成器會生成一些引用Mybatis XML配置的mapper接口。 * The file specifies only one table will be introspected, but many more could be specified. Important notes about the specified table include: * The generated objects will be based on the name Customer (`CustomerKey`, `Customer`, `CustomerMapper`, etc.) - rather than on the table name. * Actual column names will be used as properties. If this property were set to `false` (or not specified), then MBG would attempt to camel case the column names. In either case, the name can be overridden by the `&lt;columnOverride&gt;` element * The column has a generated key, it is an identity column, and the database type is DB2. This will cause MBG to generate the proper `&lt;selectKey&gt;` element in the generated `&lt;insert&gt;` statement so that the newly generated key can be returned (using DB2 specific SQL). * The column `DATE_FIELD` will be mapped to a property called `startDate`. This will override the default property which would be `DATE_FIELD` in this case, or `dateField` if the `useActualColumnNames` property was set to `false`. * The column `FRED` will be ignored. No SQL will list the field, and no Java property will be generated. * The column `LONG_VARCHAR_FIELD` will be treated as a `VARCHAR` field, regardless of the actual data type.
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看