MyBatis Generator模板
生活随笔
收集整理的這篇文章主要介紹了
MyBatis Generator模板
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
注:注意替換紅色部分 <?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:\reporty\repository\com\oracle\ojdbc14\10.2.0.1.0\ojdbc14-10.2.0.1.0.jar" /> <context id="context1"> <commentGenerator> <!-- 是否去除自動生成的注釋 true:是 : false:否 --> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 數據庫鏈接URL、用戶名、密碼 --> <jdbcConnection connectionURL="jdbc:oracle:thin:@地址:端口號:數據庫名" driverClass="oracle.jdbc.driver.OracleDriver" userId="用戶名" password="密碼" /> <!-- 生成模型的包名和位置 --> <javaModelGenerator targetPackage="組織名.項目名.模塊名.domain" targetProject="項目名-模塊名/src/main/java" /> <!-- 生成的映射文件包名和位置 --> <sqlMapGenerator targetPackage="組織名.項目名.模塊名.server.dao" targetProject="項目名-模塊名/src/main/java" /> <!-- 生成DAO的包名和位置 --> <javaClientGenerator targetPackage="組織名.項目名.模塊名.server.dao" targetProject="項目名-模塊名/src/main/java" type="XMLMAPPER" /> <!--schema為數據庫名 (更改tableName 和domainObjectName 即可) --> <table tableName="數據庫表名" domainObjectName="對應實體類名" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> <columnOverride column="列名" property="屬性名" /> <columnOverride column="ACTIVE" property="active" /> <columnOverride column="CREATE_TIME" property="createTime" /> <columnOverride column="CREATE_USER_CODE" property="createUserCode" /> <columnOverride column="MODIFY_TIME" property="modifyTime" /> <columnOverride column="MODIFY_USER_CODE" property="modifyUserCode" /> </table> </context> </generatorConfiguration>
轉載于:https://www.cnblogs.com/goingforward/p/7215254.html
總結
以上是生活随笔為你收集整理的MyBatis Generator模板的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 第八章.设计原则
- 下一篇: 人人都是产品经理读书笔记(四)