加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

generator.xml自动生成配置

发布时间:2020-12-16 05:52:23 所属栏目:百科 来源:网络整理
导读:?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
<?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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读