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模板的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 第八章.设计原则
- 下一篇: 人人都是产品经理读书笔记(四)