mybatis xml自动映射 配置文件

本文介绍了MyBatis Generator的配置文件,详细讲解了如何设置XML自动映射,帮助开发者自动生成Mapper代码,提高开发效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

MyBatis Generator Configuration File文件配置

<generatorConfiguration>
	<!-- 配置驱动 -- 填写mysql的connerctor架包>
	<classPathEntry location="E:\Java_Tools\programmingRelated\SoftwareInstallation\mysql-connector-java-5.1.21.jar" />

	<context id="context1">
		<commentGenerator>
			<property name="suppressDate" value="true" />
			<!-- 是否去除自动生成的注释 true:是 : false:否 -->
			<property name="suppressAllComments" value="true" />
		</commentGenerator>
		<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/mybatis" userId="root" password="root" />
		<!-- 1、领域模型 -- tagetPackage:生成包名;targetProject:生成项目对象名>
		<javaModelGenerator targetPackage="com.mybatis.system.model" targetProject="MyMybatis-ORM" />
		<!-- 2、xml文件 -->
		<sqlMapGenerator targetPackage="com.mybatis.system.mapper" targetProject="MyMybatis-ORM" />
		<!-- 3、接口 -->
		<javaClientGenerator targetPackage="com.mybatis.system.dao" targetProject="MyMybatis-ORM" type="XMLMAPPER" />

		<table tableName="sys_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>
		<table tableName="sys_menu" domainObjectName="Menu" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>
		<table tableName="sys_role" domainObjectName="Role" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>
		<table tableName="sys_role_menu" domainObjectName="RoleMenu" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>
		<table tableName="sys_user_role" domainObjectName="UserRole" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false"
			selectByExampleQueryId="false"></table>

	</context>
</generatorConfiguration>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值