Eclipse通过插件生成代码

<?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>
	<classPathEntry
		location="E:\eclipse\code\Ccs\WebContent\WEB-INF\lib\mysql-connector-java-5.1.7-bin.jar" /><!-- 
		数据库架包地址 -->
	 
	<context id="testTables" targetRuntime="MyBatis3">
		 
		<commentGenerator>
			    
			<property name="suppressTypeWarnings" value="true" />
			    
			<property name="suppressAllComments" value="true" />
			     
			<property name="suppressDate" value="true" />
			 
		</commentGenerator>
		 
		<jdbcConnection connectionURL="jdbc:mysql://localhost:3306/ccs"
			driverClass="com.mysql.jdbc.Driver" password="123456" userId="root" />
		 
		<javaTypeResolver>
			 
			    
			<property name="forceBigDecimals" value="false" />
			  
		</javaTypeResolver>
		 
		 
		<!-- 生产po类 -->
		 
		<javaModelGenerator targetPackage="com.ccs.domain"
			targetProject="Ccs/src"><!--把po类产生的项目地址 -->
			        
			<property name="enableSubPackages" value="false" />
			    
			<property name="trimStrings" value="true" />
			 
		</javaModelGenerator>
		 
		<!-- 生产mapper映射文件 -->
		<sqlMapGenerator targetPackage="com.ccs.dao"
			targetProject="Ccs/src"><!--把mapper映射文件产生的项目地址 -->
			    
			<property name="enableSubPackages" value="false" />
		</sqlMapGenerator>
		 
		 <!-- 生产接口 -->
		<javaClientGenerator targetPackage="com.ccs.dao"
			implementationPackage="com.ccs.dao" targetProject="Ccs/src" type="XMLMAPPER">
			    
			<property name="enableSubPackages" value="false" />
			 
		</javaClientGenerator>
		 
		 <!-- 指定数据库表 ,可以多张表一起自动生成 -->
		 
		<table schema="ccss" tableName="user" /><!--第一个参数自己定义,第二个参数必须是数据库表名 -->
		 <!--  <table schema="???" tableName="???"/> -->
		<!--  <table schema="???" tableName="???"/> -->
		<!--  <table schema="???" tableName="???"/> -->
		 <!--  <table schema="???" tableName="???"/> -->
		 
	</context>
</generatorConfiguration>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值