generatorConfig.xml 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <context id="MySqlContext" targetRuntime="MyBatis3" defaultModelType="flat">
  9. <!--指明数据库的用于标记数据库对象名的符号-->
  10. <property name="beginningDelimiter" value="`"/>
  11. <property name="endingDelimiter" value="`"/>
  12. <property name="javaFileEncoding" value="UTF-8"/>
  13. <!-- 为模型生成序列化方法-->
  14. <plugin type="org.mybatis.generator.plugins.SerializablePlugin"/>
  15. <!-- 为生成的Java模型创建一个toString方法 -->
  16. <plugin type="org.mybatis.generator.plugins.ToStringPlugin"/>
  17. <!--生成mapper.xml时覆盖原文件-->
  18. <plugin type="org.mybatis.generator.plugins.UnmergeableXmlMappersPlugin" />
  19. <!-- 为生成的实体类增加注释用的 -->
  20. <commentGenerator type="com.cl.mbg.CommentGenerator">
  21. <!-- 是否去除自动生成的注释 true:是 : false:否 -->
  22. <property name="suppressAllComments" value="true"/>
  23. <!-- 是否去除生成日期 true:是 : false:否 -->
  24. <property name="suppressDate" value="true"/>
  25. <!-- 是否添加数据库内的注释 true:是 : false:否 -->
  26. <property name="addRemarkComments" value="true"/>
  27. </commentGenerator>
  28. <jdbcConnection driverClass="${jdbc.driverClass}"
  29. connectionURL="${jdbc.connectionURL}"
  30. userId="${jdbc.userId}"
  31. password="${jdbc.password}">
  32. <property name="nullCatalogMeansCurrent" value="true" />
  33. </jdbcConnection>
  34. <javaModelGenerator targetPackage="com.cl.mbg.model" targetProject="mbg/src/main/java"/>
  35. <sqlMapGenerator targetPackage="com.cl.mbg.mapper" targetProject="mbg/src/main/resources"/>
  36. <javaClientGenerator type="XMLMAPPER" targetPackage="com.cl.mbg.mapper"
  37. targetProject="mbg/src/main/java"/>
  38. <!--生成全部表tableName设为%-->
  39. <table tableName="%">
  40. <generatedKey column="id" sqlStatement="SELECT LAST_INSERT_ID()" identity="true"/>
  41. </table>
  42. </context>
  43. </generatorConfiguration>