-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathgeneratorConfig.xml
66 lines (57 loc) · 2.91 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
<?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>
<!-- mybatis-generator:generate -->
<!--targetRuntime="MyBatis3"-->
<context id="MysqlTables" targetRuntime="tk.mybatis.mapper.generator.TkMyBatis3Impl">
<!-- 生成的Java文件的编码 -->
<property name="javaFileEncoding" value="UTF-8"/>
<!-- 格式化java代码-->
<property name="javaFormatter" value="org.mybatis.generator.api.dom.DefaultJavaFormatter"/>
<!-- 格式化XML代码 -->
<property name="xmlFormatter" value="org.mybatis.generator.api.dom.DefaultXmlFormatter"/>
<plugin type="${xml.mapperPlugin}">
<property name="mappers" value="${xml.mapperMapper}"/>
<!-- caseSensitive默认false,当数据库表名区分大小写时,可以将该属性设置为true -->
<property name="caseSensitive" value="true"/>
</plugin>
<!-- 去掉生成出来的代码的注解 -->
<commentGenerator>
<property name="suppressAllComments" value="true"/>
<property name="suppressDate" value="true"/>
</commentGenerator>
<jdbcConnection driverClass="${jdbc.driver}"
connectionURL="${jdbc.url}"
userId="${jdbc.username}"
password="${jdbc.password}"/>
<javaTypeResolver>
<property name="forceBigDecimals" value="true"/>
</javaTypeResolver>
<javaModelGenerator targetPackage="${xml.modelPackage}"
targetProject="${xml.javaProject}">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<sqlMapGenerator
targetPackage="${xml.xmlPackage}"
targetProject="${xml.resourcesProject}">
<property name="enableSubPackages" value="false"/>
</sqlMapGenerator>
<javaClientGenerator
targetPackage="${xml.mapperPackage}"
targetProject="${xml.javaProject}"
type="XMLMAPPER">
</javaClientGenerator>
<!-- 这里设置表的相关信息 -->
<table tableName="${xml.tableName}" domainObjectName="${xml.objectName}" mapperName="${xml.mapperName}"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false" modelType="flat">
<property name="useActualColumnNames" value="false"/>
<generatedKey column="" sqlStatement="MySql" identity="true"/>
<!--<generatedKey column="ID"-->
<!--sqlStatement="SELECT LAST_INSERT_ID()" />-->
</table>
</context>
</generatorConfiguration>