标签:org dao oct 配置 main enable pac ext sub
generator.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://localhost:3306/rbac2"
userId="root"
password="root">
</jdbcConnection>
<!--javaBean的生成策略-->
<javaModelGenerator targetPackage="com.blb.dto"
targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!--映射文件的生成策略-->
<sqlMapGenerator targetPackage="com.blb.mapper"
targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!--dao接口java文件的生成策略-->
<javaClientGenerator type="XMLMAPPER"
targetPackage="com.blb.dao"
targetProject=".\src\main\java">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!--数据表与javaBean的映射-->
<table tableName="tuser" domainObjectName="User"></table>
<table tableName="trole" domainObjectName="Role"></table>
<table tableName="tmenu" domainObjectName="Menu"></table>
<table tableName="t_user_role" domainObjectName="UserRole"></table>
<table tableName="t_role_menu" domainObjectName="RoleMenu"></table>
</context>
</generatorConfiguration>
标签:org dao oct 配置 main enable pac ext sub
原文地址:https://www.cnblogs.com/Tsugar/p/12296152.html