1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <!--
3+ ~ Copyright (c) 2018.
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+ <!-- 数据Model属性对应Column获取插件 -->
30+ <plugin type =" com.itfsw.mybatis.generator.plugins.ModelColumnPlugin" />
31+ <!-- Selective选择插入更新增强插件 -->
32+ <plugin type =" com.itfsw.mybatis.generator.plugins.SelectiveEnhancedPlugin" />
33+ <!-- Example Criteria 增强插件 -->
34+ <plugin type =" com.itfsw.mybatis.generator.plugins.ExampleEnhancedPlugin" />
35+
36+ <!-- jdbc的数据库连接 -->
37+ <jdbcConnection driverClass =" ${driver}" connectionURL =" ${url}" userId =" ${username}" password =" ${password}" />
38+ <!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
39+ targetPackage 指定生成的model生成所在的包名
40+ targetProject 指定在该项目下所在的路径 -->
41+ <javaModelGenerator targetPackage =" " targetProject =" " >
42+ <!-- 是否对model添加 构造函数 -->
43+ <property name =" constructorBased" value =" true" />
44+ <!-- 给Model添加一个父类 -->
45+ <!-- <property name="rootClass" value="com.itfsw.base"/>-->
46+ </javaModelGenerator >
47+ <!-- Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
48+ <sqlMapGenerator targetPackage =" " targetProject =" " />
49+ <!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
50+ type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
51+ type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
52+ type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
53+ <javaClientGenerator targetPackage =" " targetProject =" " type =" XMLMAPPER" />
54+
55+ <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
56+ <table tableName =" tb" >
57+ <columnOverride column =" field1" javaType =" java.sql.Array" typeHandler =" org.apache.ibatis.type.ArrayTypeHandler" />
58+ </table >
59+ </context >
60+ </generatorConfiguration >
0 commit comments