<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 運行 MyBatis Generator 后的任務 在您運行 MyBatis Generator (MBG)后, 您需要創建或者修改其他的 MyBatis 或 iBATIS 配置文件。 主要的任務如下: * 對 MyBatis 3.x: * 創建或修改 MapperConfig.xml 文件 * 對 iBATIS 2.x: * 創建或修改 SqlMapConfig.xml 文件 * 創建或修改 dao.xml 文件 (只有當您使用iBATIS DAO 框架時) 下面將詳細地介紹每個任務。 ## 更新 MapperConfig.xml 文件 (MyBatis 3.x) MyBatis 3.x 使用了一個 XML 文件, 通常的名字是 `MapperConfig.xml`, 聲明數據庫連接信息, 事務管理方案, 和 將會用在MyBatis會話中的 XML mapper 文件。 MBG 不會為您創建這個文件,因為它對您執行環境一無所知。然而,一些在此文件中的項目直接涉及 MBG 生成項目。 請參閱標準 MyBatis 數據映射開發指南有關不同的配置選項的詳細信息。 MBG 具體需要在配置文件中的有如下: * 必須列出MBG 生成的 XML 映射文件 例如,假設MBG已經生成一個名為`MyTableMapper.xml`的XML映射文件, 并且該文件已經在您的項目的`test.xml`包中。 `MapperConfig.xml` 文件應該有這些條目: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <configuration> <!-- 安裝適合于您的環境的事務管理器和數據源 --> <environments default"..."> <environment id"..."> <transactionManager type="..."> </transactionManager> <dataSource type="..."> </dataSource> </environment> </environments> <mappers> <!-- XML mapper 文件應該在這里列出來 --> <mapper resource="test/xml/MyTable_SqlMap.xml" /> </mappers> </configuration> ``` 如果有多個XML mapper文件(這很常見), 然后您可以通過反復的使用`&lt;mapper&gt;` 按任意順序在`&lt;mappers&gt;`元素中列出這些文件。 **生成 MapperConfig.xml** 您可能會要MBG使用MapperConfigPlugin生成一個Mapper配置文件的骨架。 查看[&lt;插件&gt;](configreference/plugin.html)頁面獲取詳細信息。 ## Updating the SqlMapConfig.xml File (iBATIS 2.x) iBATIS 2 uses an XML file, commonly named `SqlMapConfig.xml`, to specify information for a database connection, a transaction management scheme, and SQL map XML files that will be used in an iBATIS session. MBG cannot create this file for you because MBG knows nothing about your execution environment. However, some of the items in this file relate directly to MBG generated items. Please refer to the standard iBATIS data mapper developer guide for details about the different configuration options. MBG specific needs in the configuration file are as follows: * Statement namespaces must be enabled * MBG generated SQL Map XML files must be listed For example, suppose that MBG has generated an SQL Map XML file called `MyTable_SqlMap.xml`, and that the file has been placed in the `test.xml` package of your project. The `SqlMapConfig.xml` file should have these entries: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN" "http://ibatis.apache.org/dtd/sql-map-config-2.dtd"> <sqlMapConfig> <!-- Statement namespaces are required for MBG --> <settings useStatementNamespaces="true" /> <!-- Setup the transaction manager and data source that are appropriate for your environment --> <transactionManager type="..."> <dataSource type="..."> </dataSource> </transactionManager> <!-- SQL Map XML files should be listed here --> <sqlMap resource="test/xml/MyTable_SqlMap.xml" /> </sqlMapConfig> ``` If there is more than one SQL Map XML file (as is quite common), then the files can be listed in any order with repeated `&lt;sqlMap&gt;` elements after the `&lt;transactionManager&gt;` element. **Version 1.2 New Enhancement** With MBG version 1.2 and later, You may ask MBG to generate a skeleton SQL Map Configuration file with the SqlMapConfigPlugin. See the [&lt;plugin&gt;](configreference/plugin.html) page for more information. ## Updating the dao.xml File (iBATIS 2.x) **重要提示:** this step is only required if you generated DAOs for the deprecated iBATIS DAO framework (we suggest using Spring instead). The iBATIS DAO framework is configured by an xml file commonly called `dao.xml`. The iBATIS DAO framework uses this file to control the database connection information for DAOs, and also to list the DAO implementation classes and DAO interfaces. In this file you should specify the path to your `SqlMapConfig.xml` file, and all the MBG generated DAO interfaces and implementation classes. For example, suppose that MBG has generated a DAO interface called `MyTableDAO` and a implementation class called `MyTableDAOImpl`, and that the files have been placed in the `test.dao` package of your project. The `dao.xml` file should have these entries: ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE daoConfig PUBLIC "-//ibatis.apache.org//DTD DAO Configuration 2.0//EN" "http://ibatis.apache.org/dtd/dao-2.dtd"> <daoConfig> <context> <transactionManager type="SQLMAP"> <property name="SqlMapConfigResource" value="test/SqlMapConfig.xml"/> </transactionManager> <!-- DAO interfaces and implementations should be listed here --> <dao interface="test.dao.MyTableDAO" implementation="test.dao.MyTableDAOImpl" /> </context> </daoConfig> ```
                  <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>

                              哎呀哎呀视频在线观看