generatorConfig.xml 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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="application.properties"/>
  8. <!-- 指定数据库连接驱动jar地址 -->
  9. <!-- <classPathEntry location="D:/jar/ojdbc6.jar" />-->
  10. <classPathEntry location="D:/jar/mysql-connector-java-8.0.11.jar" />
  11. <!-- 一个数据库一个context -->
  12. <context id="mysqlTables">
  13. <!-- 生成的pojo,将implements Serializable -->
  14. <plugin type="org.mybatis.generator.plugins.SerializablePlugin"></plugin>
  15. <!-- 注释 -->
  16. <commentGenerator>
  17. <property name="suppressAllComments" value="true" /><!-- 是否取消注释 -->
  18. <!-- <property name="suppressDate" value="true" /> 是否生成注释代时间戳 -->
  19. </commentGenerator>
  20. <!-- 数据库链接URL、用户名、密码 -->
  21. <!-- <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
  22. connectionURL="jdbc:oracle:thin:@localhost:1521:SWOM"
  23. userId="monitor"
  24. password="123456">-->
  25. <jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
  26. connectionURL="jdbc:mysql://114.135.61.188:33306/operation_manager?serverTimezone=UTC&amp;useSSL=false"
  27. userId="root"
  28. password="100Zone@123">
  29. <property name="useInformationSchema" value="true"/>
  30. </jdbcConnection>
  31. <!-- 类型转换 -->
  32. <javaTypeResolver>
  33. <!-- 默认false,把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer true,把JDBC DECIMAL
  34. 和 NUMERIC 类型解析为java.math.BigDecimal -->
  35. <property name="forceBigDecimals" value="false" />
  36. </javaTypeResolver>
  37. <!-- 生成model模型,对应的包路径,以及文件存放路径(targetProject),targetProject可以指定具体的路径,如./src/main/java,
  38. 也可以使用“MAVEN”来自动生成,这样生成的代码会在target/generatord-source目录下 -->
  39. <javaModelGenerator targetPackage="com.huaxu.task.entity"
  40. targetProject="./src/main/java">
  41. <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
  42. <property name="enableSubPackages" value="false" />
  43. <!-- 从数据库返回的值被清理前后的空格 -->
  44. <property name="trimStrings" value="true" />
  45. </javaModelGenerator>
  46. <!--对应的mapper.xml文件 -->
  47. <sqlMapGenerator targetPackage="mapper/task"
  48. targetProject="./src/main/resources">
  49. <property name="enableSubPackages" value="false" />
  50. </sqlMapGenerator>
  51. <!-- 对应的Mapper接口类文件 -->
  52. <javaClientGenerator type="XMLMAPPER"
  53. targetPackage="com.huaxu.task.dao" targetProject="./src/main/java">
  54. <property name="enableSubPackages" value="false" />
  55. </javaClientGenerator>
  56. <!-- 列出要生成代码的所有表,这里配置的是不生成Example文件 -->
  57. <!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成的实体类 enable*ByExample
  58. 是否生成 example类 -->
  59. <table tableName="sc_work_flow_log" domainObjectName="WorkFlowLog222"
  60. enableCountByExample="false"
  61. enableUpdateByExample="false"
  62. enableDeleteByExample="false"
  63. enableSelectByExample="false"
  64. selectByExampleQueryId="false"
  65. enableSelectByPrimaryKey="true">
  66. <!-- 忽略列,不生成bean 字段
  67. <ignoreColumn column="FRED" />-->
  68. <!-- 指定列的java数据类型
  69. <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" /> -->
  70. <!-- 用于指定生成实体类时是否使用实际的列名作为实体类的属性名。false是 Camel Case风格-->
  71. <property name="useActualColumnNames" value="false" />
  72. </table>
  73. </context>
  74. </generatorConfiguration>