-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeneratorConfig.xml
More file actions
45 lines (42 loc) · 2.08 KB
/
generatorConfig.xml
File metadata and controls
45 lines (42 loc) · 2.08 KB
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
<?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>
<!-- MySql数据库链接URL、用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/ssm_crud?characterEncoding=utf8"
userId="root" password="root">
</jdbcConnection>
<!-- 默认是false,把JDBC DECIMAL和NUMERIC 类型解析为 Integer 设置为true表示把JDBC DECIMAL和NUMERIC
类型解析为 java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!-- 生成pojo模型的包名和位置 -->
<javaModelGenerator targetPackage="cn.lynu.model"
targetProject=".\src\main\java">
<!-- enableSubPackages是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!--trimStrings从数据库中返回的值将被清理前后空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- 生成的mapper映射文件包名和位置 -->
<sqlMapGenerator targetPackage="mapper"
targetProject=".\src\main\resources">
<property name="enableSubPackages" value="false" />
</sqlMapGenerator>
<!-- 生成mapper接口的包名和位置 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="cn.lynu.mapper" targetProject=".\src\main\java">
<property name="enableSubPackages" value="false" />
</javaClientGenerator>
<!-- 指定数据库中的表 ,可以使用domainObjectName指定表生成的pojo类名-->
<!--<table tableName="tbl_emp" domainObjectName="Employee"></table>-->
<table tableName="tb_emp" domainObjectName="Employee"/>
<table tableName="tb_dept" domainObjectName="Department"/>
</context>
</generatorConfiguration>