mybatis-generator.xml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE generatorConfiguration PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
  3. "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd" >
  4. <generatorConfiguration>
  5. <!-- 引入配置文件 -->
  6. <properties resource="mybatis-generator.properties"/>
  7. <!-- 指定数据连接驱动jar地址 -->
  8. <classPathEntry location="${generator.classPath}"/>
  9. <!-- 一个数据库一个context -->
  10. <context id="BuildingTables" targetRuntime="Mybatis3">
  11. <!-- defaultModelType="hierarchical" -->
  12. <property name="javaFileEncoding" value="UTF-8"/>
  13. <property name="suppressTypeWarnings" value="true"/>
  14. <property name="useActualColumnNames" value="false"/>
  15. <!-- 注释 -->
  16. <commentGenerator type="cn.com.goldenwater.dcproj.utils.CommentGenerator">
  17. <!-- 是否去除自动生成的注释 true:是 : false:否 -->
  18. <property name="suppressAllComments" value="true"/>
  19. <property name="suppressDate" value="true"/>
  20. <property name="addRemarkComments" value="true"/>
  21. </commentGenerator>
  22. <!-- jdbc连接 -->
  23. <jdbcConnection driverClass="${jdbc.driverClassName}"
  24. connectionURL="${jdbc.url}" userId="${jdbc.username}" password="${jdbc.password}">
  25. <!-- 设置可以获取 tables remarks信息 -->
  26. <property name="useInformationSchema" value="true"/>
  27. <!-- 设置可以获取 remarks信息 -->
  28. <property name="remarks" value="true"/>
  29. </jdbcConnection>
  30. <!-- 类型转换 -->
  31. <javaTypeResolver>
  32. <!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
  33. <property name="forceBigDecimals" value="false"/>
  34. </javaTypeResolver>
  35. <!-- 生成实体类地址 -->
  36. <javaModelGenerator targetPackage="${generator.domainPackage}"
  37. targetProject="${generator.targetProject}/src/main/java">
  38. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  39. <property name="enableSubPackages" value="true"/>
  40. <!-- 是否针对string类型的字段在set的时候进行trim调用 -->
  41. <property name="trimStrings" value="true"/>
  42. <property name="defaultModelType" value="flat"/>
  43. </javaModelGenerator>
  44. <!-- 生成mapxml文件 -->
  45. <sqlMapGenerator targetPackage="${generator.mapperPackage}"
  46. targetProject="${generator.targetProject}/src/main/resources">
  47. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  48. <property name="enableSubPackages" value="true"/>
  49. </sqlMapGenerator>
  50. <!-- 生成mapxml对应client,也就是接口dao -->
  51. <javaClientGenerator targetPackage="${generator.daoPackage}"
  52. targetProject="${generator.targetProject}/src/main/java" type="XMLMAPPER">
  53. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  54. <property name="enableSubPackages" value="true"/>
  55. </javaClientGenerator>
  56. <!-- 配置表信息 -->
  57. <!-- <table tableName="JG_ZTK_JGXN_SSJYGK_SPOT_CHECK" domainObjectName="JgZTKSpotCheck"
  58. enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
  59. enableSelectByExample="false" selectByExampleQueryId="false"/>
  60. <table tableName="JG_ZTK_JGXN_SSJYGK_ZXJHSJ" domainObjectName="JgZTKZxjhsj"
  61. enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
  62. enableSelectByExample="false" selectByExampleQueryId="false"/>
  63. -->
  64. <table tableName="CHK_SAFE_PROD_LEDGER" domainObjectName="chkSafeProdLedger"
  65. enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
  66. enableSelectByExample="false" selectByExampleQueryId="false"/>
  67. </context>
  68. </generatorConfiguration>