-
Notifications
You must be signed in to change notification settings - Fork 0
/
generatorConfig.xml
137 lines (126 loc) · 7.59 KB
/
generatorConfig.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfiguration
PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<context id="testTables" targetRuntime="MyBatis3">
<commentGenerator>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!--数据库连接的信息:驱动类、连接地址、用户名、密码 -->
<!--3306后面跟数据库名称-->
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/cskaoyan_mall_db?serverTimezone=UTC&"
userId="root"
password="ss7832459">
<!--是否去除同名表-->
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
<!--<!–
for oracle
–>
<jdbcConnection driverClass="oracle.jdbc.OracleDriver"
connectionURL="jdbc:oracle:thin:@127.0.0.1:1521:yycg"
userId="yycg"
password="yycg">
</jdbcConnection>-->
<!-- 默认false,
为false把JDBC DECIMAL 和 NUMERIC 类型解析为Integer,
为 true把JDBC DECIMAL 和 NUMERIC 类型解析为java.math.BigDecimal -->
<!--<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>-->
<!-- javaModelGenerator javaBean生成的配置信息
targetProject:生成PO类的位置
targetPackage:生成PO类的类名-->
<javaModelGenerator targetPackage="com.cskaoyan.springboot.demo.bean"
targetProject=".\src\main\java">
<!-- enableSubPackages:是否允许子包,是否让schema作为包的后缀
即targetPackage.schemaName.tableName -->
<property name="enableSubPackages" value="true" />
<!-- 从数据库返回的值是否清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- sqlMapGenerator Mapper映射文件的配置信息
targetProject:mapper映射文件生成的位置
targetPackage:生成mapper映射文件放在哪个包下-->
<sqlMapGenerator targetPackage="com.cskaoyan.springboot.demo.mapper"
targetProject=".\src\main\resources">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!--
javaClientGenerator 生成 Model对象(JavaBean)和 mapper XML配置文件 对应的Dao代码
targetProject:mapper接口生成的位置
targetPackage:生成mapper接口放在哪个包下
ANNOTATEDMAPPER 纯注解
XMLMAPPER 纯映射文件
MIXEDMAPPER 注解与映射文件混合
-->
<javaClientGenerator type="XMLMAPPER"
targetPackage="com.cskaoyan.springboot.demo.mapper"
targetProject=".\src\main\java">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="true" />
</javaClientGenerator><!---->
<!-- 指定数据库表 -->
<!-- 指定所有数据库表 -->
<!--<table tableName="%"
enableCountByExample="false"
enableUpdateByExample="false"
enableDeleteByExample="false"
enableSelectByExample="false"
enableInsert="false"
enableDeleteByPrimaryKey="true"
enableSelectByPrimaryKey="true"
selectByExampleQueryId="false" ></table>-->
<!-- 指定数据库表,要生成哪些表,就写哪些表,要和数据库中对应,不能写错! -->
<!--<table tableName="device" domainObjectName="Device"></table>
<table tableName="device_check" domainObjectName="DeviceCheck"></table>
<table tableName="device_fault" domainObjectName="DeviceFault"></table>
<table tableName="device_maintain" domainObjectName="DeviceMaintain"></table>
<table tableName="device_type" domainObjectName="DeviceType"></table>
<table tableName="employee" domainObjectName="Employee"></table>
-->
<table tableName="cskaoyan_mall_ad" domainObjectName="Ad"></table>
<table tableName="cskaoyan_mall_address" domainObjectName="Address"></table>
<table tableName="cskaoyan_mall_admin" domainObjectName="Admin"></table>
<table tableName="cskaoyan_mall_brand" domainObjectName="Brand"></table>
<table tableName="cskaoyan_mall_cart" domainObjectName="Cart"></table>
<table tableName="cskaoyan_mall_category" domainObjectName="Category"></table>
<table tableName="cskaoyan_mall_comment" domainObjectName="Comment"></table>
<table tableName="cskaoyan_mall_coupon" domainObjectName="Coupon"></table>
<table tableName="cskaoyan_mall_coupon_user" domainObjectName="CouponUser"></table>
<table tableName="cskaoyan_mall_feedback" domainObjectName="Feedback"></table>
<table tableName="cskaoyan_mall_footprint" domainObjectName="Footprint"></table>
<table tableName="cskaoyan_mall_goods" domainObjectName="Goods"></table>
<table tableName="cskaoyan_mall_goods_attribute" domainObjectName="GoodsAttribute"></table>
<table tableName="cskaoyan_mall_goods_product" domainObjectName="GoodsProduct"></table>
<table tableName="cskaoyan_mall_goods_specification" domainObjectName="GoodsSpecification"></table>
<table tableName="cskaoyan_mall_groupon" domainObjectName="Groupon"></table>
<table tableName="cskaoyan_mall_groupon_rules" domainObjectName="GrouponRules"></table>
<table tableName="cskaoyan_mall_issue" domainObjectName="Issue"></table>
<table tableName="cskaoyan_mall_keyword" domainObjectName="Keyword"></table>
<table tableName="cskaoyan_mall_log" domainObjectName="Log"></table>
<table tableName="cskaoyan_mall_order" domainObjectName="Order"></table>
<table tableName="cskaoyan_mall_order_goods" domainObjectName="OrderGoods"></table>
<table tableName="cskaoyan_mall_permission" domainObjectName="Permission"></table>
<table tableName="cskaoyan_mall_region" domainObjectName="Region"></table>
<table tableName="cskaoyan_mall_role" domainObjectName="Role"></table>
<table tableName="cskaoyan_mall_search_history" domainObjectName="SearchHistory"></table>
<table tableName="cskaoyan_mall_storage" domainObjectName="Storage"></table>
<table tableName="cskaoyan_mall_system" domainObjectName="System"></table>
<table tableName="cskaoyan_mall_topic" domainObjectName="Topic"></table>
<table tableName="cskaoyan_mall_user" domainObjectName="User"></table>
<table tableName="cskaoyan_mall_user_formid" domainObjectName="UserFormid"></table>
<!-- <table schema="" tableName="orders"></table>
<table schema="" tableName="items"></table>
<table schema="" tableName="orderdetail"></table>
-->
<!-- 有些表的字段需要指定java类型
<table schema="" tableName="">
<columnOverride column="" javaType="" />
</table> -->
</context>
</generatorConfiguration>