generatorConfig.xml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN" "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
  3. <generatorConfiguration >
  4. <!-- 引入配置文件 -->
  5. <properties url="file:////Users/justin/Documents/workspace/HS-PIMP/PreRegistration/src/main/resources/init.properties"/>
  6. <!-- 指定数据连接驱动jar地址 -->
  7. <classPathEntry location="${jarClassPath}" />
  8. <!-- 一个数据库一个context -->
  9. <context id="context">
  10. <!-- 注释 -->
  11. <commentGenerator>
  12. <property name="suppressAllComments" value="false" /><!-- 是否取消注释 -->
  13. <property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 -->
  14. </commentGenerator>
  15. <!-- jdbc连接 -->
  16. <jdbcConnection driverClass="${jdbc_driver}" connectionURL="${jdbc_url}" userId="${jdbc_user}" password="${jdbc_password}" />
  17. <!-- 类型转换 -->
  18. <javaTypeResolver>
  19. <!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
  20. <property name="forceBigDecimals" value="false"/>
  21. </javaTypeResolver>
  22. <!-- 生成实体类地址 -->
  23. <javaModelGenerator targetPackage="${targetPackage.pojo}" targetProject="${targetProject}" >
  24. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  25. <property name="enableSubPackages" value="false"/>
  26. <!-- 是否针对string类型的字段在set的时候进行trim调用 -->
  27. <property name="trimStrings" value="true"/>
  28. </javaModelGenerator>
  29. <!-- 生成mapxml文件 -->
  30. <sqlMapGenerator targetPackage="${targetPackage.mapping}" targetProject="${targetProject}" >
  31. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  32. <property name="enableSubPackages" value="false" />
  33. </sqlMapGenerator>
  34. <!-- 生成mapxml对应client,也就是接口dao -->
  35. <javaClientGenerator targetPackage="${targetPackage.dao}" targetProject="${targetProject}" type="XMLMAPPER" >
  36. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  37. <property name="enableSubPackages" value="false" />
  38. </javaClientGenerator>
  39. <table tableName="SECTIONTYPE_DICTIONARY" domainObjectName="SectiontypeDictionary" >
  40. </table>
  41. </context>
  42. </generatorConfiguration>