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>

	<!-- 指定数据连接驱动jar地址 -->
	<classpathEntry location="E:/jars/generator_tool/ojdbc14.jar" />


	<context id="my" targetRuntime="MyBatis3">
		<commentGenerator>
			<property name="suppressAllComments" value="false" /><!-- 是否取消注释 -->
			<property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 -->
		</commentGenerator>



		<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
			connectionURL="jdbc:oracle:thin:@60.191.250.12:1521:ORCL" userId="scweb"
			password="scweb" />

		<!-- 生成实体类地址 -->
		<javaModelGenerator targetPackage="com.credit.entity"
			targetProject="E:/workspaces/new_space/DBHandler/src/main/java">
			<property name="enableSubPackages" value="true" />
			<property name="trimstrings" value="true" />
		</javaModelGenerator>

		<!-- 生成mapxml文件 -->
		<sqlMapGenerator targetPackage="com.credit.dao.oracle"
			targetProject="E:/workspaces/new_space/DBHandler/src/main/java">
			<property name="enableSubPackages" value="true" />
		</sqlMapGenerator>

		<!-- 生成mapxml对应client,也就是接口dao -->
		<javaClientGenerator targetPackage="com.credit.dao.oracle"
			targetProject="E:/workspaces/new_space/DBHandler/src/main/java" type="XMLMAPPER">
			<property name="enableSubPackages" value="true" />
		</javaClientGenerator>




		<table schema="YWXY" tableName="SYstem_DICTTYPE"
			domainObjectName="DICTTYPE" enableCountByExample="false"
			enableupdateByExample="false" enableDeleteByExample="false"
			enableSelectByExample="false" selectByExampleQueryId="false">
			<!-- schema即为数据库名 tableName为对应的数据库表 domainObjectName是要生成实体类 enable*ByExample 
				是否生成 example类 -->

			<!-- 忽略列,不生成bean 字段 -->
			<!--<ignoreColumn column="FRED" /> -->
			<!-- 指定列的java数据类型 -->
			<!--<columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" /> -->
		</table>


	</context>

</generatorConfiguration>

相关文章

php输出xml格式字符串
J2ME Mobile 3D入门教程系列文章之一
XML轻松学习手册
XML入门的常见问题(一)
XML入门的常见问题(三)
XML轻松学习手册(2)XML概念