46 lines
1.9 KiB
XML
46 lines
1.9 KiB
XML
<?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="DB2Tables" targetRuntime="MyBatis3">
|
||
<commentGenerator>
|
||
<!--true表示阻止生成注释-->
|
||
<property name="suppressAllComments" value="true" />
|
||
</commentGenerator>
|
||
<!-- 配置数据库连接 -->
|
||
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
|
||
connectionURL="jdbc:mysql://localhost:3306/ssm_crud"
|
||
userId="root"
|
||
password="8520">
|
||
</jdbcConnection>
|
||
|
||
<javaTypeResolver>
|
||
<property name="forceBigDecimals" value="false" />
|
||
</javaTypeResolver>
|
||
|
||
<!-- 指定javaBean生成的位置 -->
|
||
<javaModelGenerator targetPackage="com.atguigu.crud.bean"
|
||
targetProject=".\src\main\java">
|
||
<property name="enableSubPackages" value="true" />
|
||
<property name="trimStrings" value="true" />
|
||
</javaModelGenerator>
|
||
|
||
<!--指定sql映射文件生成的位置 -->
|
||
<sqlMapGenerator targetPackage="mapper" targetProject=".\src\main\resources">
|
||
<property name="enableSubPackages" value="true" />
|
||
</sqlMapGenerator>
|
||
|
||
<!-- 指定dao接口生成的位置,mapper接口 -->
|
||
<javaClientGenerator type="XMLMAPPER"
|
||
targetPackage="com.atguigu.crud.dao" targetProject=".\src\main\java">
|
||
<property name="enableSubPackages" value="true" />
|
||
</javaClientGenerator>
|
||
|
||
|
||
<!-- table指定每个表的生成策略 -->
|
||
<table tableName="tbl_emp" domainObjectName="Employee"></table>
|
||
<table tableName="tbl_dept" domainObjectName="Department"></table>
|
||
</context>
|
||
</generatorConfiguration> |