mybatis逆向工程二(配置文件genreatorConfig.xml)
2018-03-20 16:12
417 查看
在工程中创建xml文件,取名为:genreatorConfig.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">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/medicalplatform"
userId="root"
password="******">
</jdbcConnection>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="com.yang.bean" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProject:mapper映射文件生成的位置 -->
<sqlMapGenerator targetPackage="maper" targetProject=".\src\main\resources">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- targetPackage:mapper接口生成的位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.yang.dao" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- table标签中tableName是数据库的表名,domainObjectName的配置是你要生成的实体类文件的名字,所以我用的大写 -->
<!-- tableName代表数据库表名, domainObjectName代表要生成对应的数据库表名的名字-->
<table tableName="charge" domainObjectName="Charge" ></table>
<table tableName="cure" domainObjectName="Cure" ></table>
<table tableName="department" domainObjectName="Department" ></table>
<table tableName="doctor" domainObjectName="Doctor" ></table>
<table tableName="drug" domainObjectName="Drug" ></table>
<table tableName="examine" domainObjectName="Examine" ></table>
<table tableName="followup" domainObjectName="Followup" ></table>
<table tableName="medicalcase" domainObjectName="Medicalcase" ></table>
<table tableName="patientcure" domainObjectName="Patientcure" ></table>
<table tableName="patientexamine" domainObjectName="Patientexamine" ></table>
<table tableName="patientprescription" domainObjectName="Patientprescription" ></table>
<table tableName="preregistration" domainObjectName="Preregistration" ></table>
<table tableName="report" domainObjectName="Report" ></table>
</context>
</generatorConfiguration>
<?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">
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/medicalplatform"
userId="root"
password="******">
</jdbcConnection>
<!-- targetProject:生成PO类的位置 -->
<javaModelGenerator targetPackage="com.yang.bean" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!-- targetProject:mapper映射文件生成的位置 -->
<sqlMapGenerator targetPackage="maper" targetProject=".\src\main\resources">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!-- targetPackage:mapper接口生成的位置 -->
<javaClientGenerator type="XMLMAPPER" targetPackage="com.yang.dao" targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!-- table标签中tableName是数据库的表名,domainObjectName的配置是你要生成的实体类文件的名字,所以我用的大写 -->
<!-- tableName代表数据库表名, domainObjectName代表要生成对应的数据库表名的名字-->
<table tableName="charge" domainObjectName="Charge" ></table>
<table tableName="cure" domainObjectName="Cure" ></table>
<table tableName="department" domainObjectName="Department" ></table>
<table tableName="doctor" domainObjectName="Doctor" ></table>
<table tableName="drug" domainObjectName="Drug" ></table>
<table tableName="examine" domainObjectName="Examine" ></table>
<table tableName="followup" domainObjectName="Followup" ></table>
<table tableName="medicalcase" domainObjectName="Medicalcase" ></table>
<table tableName="patientcure" domainObjectName="Patientcure" ></table>
<table tableName="patientexamine" domainObjectName="Patientexamine" ></table>
<table tableName="patientprescription" domainObjectName="Patientprescription" ></table>
<table tableName="preregistration" domainObjectName="Preregistration" ></table>
<table tableName="report" domainObjectName="Report" ></table>
</context>
</generatorConfiguration>
相关文章推荐
- mybatis逆向工程自动生成实体类、接口以及映射Mapper.xml配置文件
- Mybatis逆向工程XML配置文件
- mybatis 逆向工程 用xml配置文件生成mapper和po的方法
- mybatis学习(二)-- mybatis-config.xml配置文件详解
- Myeclipse的插件mybatis-generator创建的配置文件generatorConfig.xml的配置详细说明
- 5~mybatis配置文件SqlMapConfig.xml
- mybatis-config.xml配置文件
- mybatis-全局配置文件-mybatis-config.xml-properties-3
- mybatis入门基础(三)----SqlMapConfig.xml全局配置文件解析
- mybatis学习总结-核心配置文件mybatis-config.xml(一)
- mybatis入门基础(三)----SqlMapConfig.xml全局配置文件解析
- spring和mybatis整合 sqlMapConfig.xml配置文件
- 解决使用Oracle库利用MyBatis配置文件逆向生成的实体类时mapping.xml里有重复的节点问题
- mybatis+mysql8.0.7配置文件mybatis_config.xml
- mybatis入门基础(三)----SqlMapConfig.xml全局配置文件解析
- mybatis核心配置文件mybatis-config.xml的配置方法和配置详情
- SqlMapConfig.xml --- 在spring配置文件中自动加载的mybatis文件
- MyBatis的SqlMapConfig.xml配置文件详解
- Mybatis的SqlMapConfig.xml配置文件模板
- Mybatis-config.xml文件的配置