1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!--
3+ ~ Copyright (c) 2019.
4+ ~
5+ ~ Licensed under the Apache License, Version 2.0 (the "License");
6+ ~ you may not use this file except in compliance with the License.
7+ ~ You may obtain a copy of the License at
8+ ~
9+ ~ http://www.apache.org/licenses/LICENSE-2.0
10+ ~
11+ ~ Unless required by applicable law or agreed to in writing, software
12+ ~ distributed under the License is distributed on an "AS IS" BASIS,
13+ ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ ~ See the License for the specific language governing permissions and
15+ ~ limitations under the License.
16+ -->
17+
18+ <!DOCTYPE generatorConfiguration
19+ PUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
20+ "http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
21+ <generatorConfiguration >
22+ <properties resource =" db.properties" />
23+ <!-- 导入属性配置 -->
24+ <context id =" default" targetRuntime =" MyBatis3" >
25+ <property name =" autoDelimitKeywords" value =" true" />
26+ <property name =" beginningDelimiter" value =" `" />
27+ <property name =" endingDelimiter" value =" `" />
28+
29+ <!-- Example 目标包修改插件 -->
30+ <plugin type =" com.itfsw.mybatis.generator.plugins.ExampleTargetPlugin" >
31+ <property name =" targetPackage" value =" com.itfsw.dao.example" />
32+ </plugin >
33+ <!-- 表重命名配置插件 -->
34+ <plugin type =" com.itfsw.mybatis.generator.plugins.TableRenameConfigurationPlugin" >
35+ <property name =" domainObjectRenamingRule.searchString" value =" ^T" />
36+ <property name =" domainObjectRenamingRule.replaceString" value =" " />
37+ </plugin >
38+
39+ <!-- jdbc的数据库连接 -->
40+ <jdbcConnection driverClass =" ${driver}" connectionURL =" ${url}" userId =" ${username}" password =" ${password}" />
41+ <!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
42+ targetPackage 指定生成的model生成所在的包名
43+ targetProject 指定在该项目下所在的路径 -->
44+ <javaModelGenerator targetPackage =" " targetProject =" " >
45+ <!-- 是否对model添加 构造函数 -->
46+ <property name =" constructorBased" value =" true" />
47+ <!-- 给Model添加一个父类 -->
48+ <!-- <property name="rootClass" value="com.itfsw.base"/>-->
49+ </javaModelGenerator >
50+ <!-- Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
51+ <sqlMapGenerator targetPackage =" " targetProject =" " />
52+ <!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
53+ type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
54+ type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
55+ type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
56+ <javaClientGenerator targetPackage =" " targetProject =" " type =" XMLMAPPER" />
57+
58+ <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
59+ <table tableName =" tb_test" />
60+ </context >
61+ </generatorConfiguration >
0 commit comments