generatorConfig.xml 2.6 KB

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