generatorConfig.xml 5.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. <context id="DB2Tables" targetRuntime="MyBatis3">
  7. <!--避免生成重复代码的插件-->
  8. <plugin type="com.how2java.tmall.util.OverIsMergeablePlugin" />
  9. <!--是否在代码中显示注释-->
  10. <commentGenerator>
  11. <property name="suppressDate" value="true" />
  12. <property name="suppressAllComments" value="true" />
  13. </commentGenerator>
  14. <!--数据库链接地址账号密码-->
  15. <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/tmall_ssm" userId="root" password="admin">
  16. </jdbcConnection>
  17. <!--不知道做什么用的。。。反正贴上来了~-->
  18. <javaTypeResolver>
  19. <property name="forceBigDecimals" value="false"/>
  20. </javaTypeResolver>
  21. <!--生成pojo类存放位置-->
  22. <javaModelGenerator targetPackage="com.how2java.tmall.pojo" targetProject="src/main/java">
  23. <property name="enableSubPackages" value="true"/>
  24. <property name="trimStrings" value="true"/>
  25. </javaModelGenerator>
  26. <!--生成xml映射文件存放位置-->
  27. <sqlMapGenerator targetPackage="mapper" targetProject="src/main/resources">
  28. <property name="enableSubPackages" value="true"/>
  29. </sqlMapGenerator>
  30. <!--生成mapper类存放位置-->
  31. <javaClientGenerator type="XMLMAPPER" targetPackage="com.how2java.tmall.mapper" targetProject="src/main/java">
  32. <property name="enableSubPackages" value="true"/>
  33. </javaClientGenerator>
  34. <!--生成对应表及类名-->
  35. <table tableName="category" domainObjectName="Category" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  36. <property name="my.isgen.usekeys" value="true"/>
  37. <property name="useActualColumnNames" value="true"/>
  38. <generatedKey column="id" sqlStatement="JDBC"/>
  39. </table>
  40. <table tableName="property" domainObjectName="Property" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  41. <property name="my.isgen.usekeys" value="true"/>
  42. <property name="useActualColumnNames" value="true"/>
  43. <generatedKey column="id" sqlStatement="JDBC"/>
  44. </table>
  45. <table tableName="product" domainObjectName="Product" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  46. <property name="my.isgen.usekeys" value="true"/>
  47. <property name="useActualColumnNames" value="true"/>
  48. <generatedKey column="id" sqlStatement="JDBC"/>
  49. </table>
  50. <table tableName="productImage" domainObjectName="ProductImage" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  51. <property name="my.isgen.usekeys" value="true"/>
  52. <property name="useActualColumnNames" value="true"/>
  53. <generatedKey column="id" sqlStatement="JDBC"/>
  54. </table>
  55. <table tableName="order_" domainObjectName="Order" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  56. <property name="my.isgen.usekeys" value="true"/>
  57. <property name="useActualColumnNames" value="true"/>
  58. <generatedKey column="id" sqlStatement="JDBC"/>
  59. </table>
  60. <table tableName="propertyValue" domainObjectName="PropertyValue" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  61. <property name="my.isgen.usekeys" value="true"/>
  62. <property name="useActualColumnNames" value="true"/>
  63. <generatedKey column="id" sqlStatement="JDBC"/>
  64. </table>
  65. <table tableName="review" domainObjectName="Review" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  66. <property name="my.isgen.usekeys" value="true"/>
  67. <property name="useActualColumnNames" value="true"/>
  68. <generatedKey column="id" sqlStatement="JDBC"/>
  69. </table>
  70. <table tableName="user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  71. <property name="my.isgen.usekeys" value="true"/>
  72. <property name="useActualColumnNames" value="true"/>
  73. <generatedKey column="id" sqlStatement="JDBC"/>
  74. </table>
  75. <table tableName="orderItem" domainObjectName="OrderItem" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="true" selectByExampleQueryId="false">
  76. <property name="my.isgen.usekeys" value="true"/>
  77. <property name="useActualColumnNames" value="true"/>
  78. <generatedKey column="id" sqlStatement="JDBC"/>
  79. </table>
  80. </context>
  81. </generatorConfiguration>