微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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>

原文地址:https://www.jb51.cc/xml/295314.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。