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+ <!-- 插件 -->
30+ <plugin type =" com.itfsw.mybatis.generator.plugins.EnumTypeStatusPlugin" />
31+
32+ <!-- jdbc的数据库连接 -->
33+ <jdbcConnection driverClass =" ${driver}" connectionURL =" ${url}" userId =" ${username}" password =" ${password}" />
34+ <!-- Model模型生成器,用来生成含有主键key的类,记录类 以及查询Example类
35+ targetPackage 指定生成的model生成所在的包名
36+ targetProject 指定在该项目下所在的路径 -->
37+ <javaModelGenerator targetPackage =" " targetProject =" " >
38+ <!-- 是否对model添加 构造函数 -->
39+ <property name =" constructorBased" value =" true" />
40+ <!-- 给Model添加一个父类 -->
41+ <!-- <property name="rootClass" value="com.itfsw.base"/>-->
42+ </javaModelGenerator >
43+ <!-- Mapper映射文件生成所在的目录 为每一个数据库的表生成对应的SqlMap文件 -->
44+ <sqlMapGenerator targetPackage =" " targetProject =" " />
45+ <!-- 客户端代码,生成易于使用的针对Model对象和XML配置文件 的代码
46+ type="ANNOTATEDMAPPER",生成Java Model 和基于注解的Mapper对象
47+ type="MIXEDMAPPER",生成基于注解的Java Model 和相应的Mapper对象
48+ type="XMLMAPPER",生成SQLMap XML文件和独立的Mapper接口 -->
49+ <javaClientGenerator targetPackage =" " targetProject =" " type =" XMLMAPPER" />
50+
51+ <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 要自动生成的表 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
52+ <table tableName =" sys_company" domainObjectName =" SysCompany" enableCountByExample =" true" >
53+ <generatedKey column =" company_id" sqlStatement =" MySql" identity =" true" />
54+ </table >
55+ </context >
56+ </generatorConfiguration >
0 commit comments