mybatis_Generator配置

mybatis-generator-core-1.3.2

<?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>
	
	<!-- The full path name of a JAR/ZIP file to add to the classpath, or a directory to add to the classpath. -->
	<classPathEntry location="./ojdbc14.jar" />
	
	<!-- id : A unique identifier for this context. This value will be used in some error messages. -->
	<!-- targetRuntime : This property is used to specify the runtime target for generated code.default is "MyBatis3"-->
	<context id="id0907" targetRuntime="MyBatis3">

		<commentGenerator>
			<property name="suppressAllComments" value="false" />
			<property name="suppressDate" value="true" />
		</commentGenerator>

		<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver"
			connectionURL="jdbc:oracle:thin:@//localhost/orcl"
			userId="ultimatefighter" password="champion" />

		<!--When the property is true, the Java type resolver will always use java.math.BigDecimal if the database column is of type DECIMAL or NUMERIC.-->
		<javaTypeResolver>
			<property name="forceBigDecimals" value="false" />
		</javaTypeResolver>

		<!-- It is used to define properties of the Java model generator. -->
		<javaModelGenerator targetPackage="com.soul.pojo" targetProject="./">
			<property name="enableSubPackages" value="false" />
			<!--  trim the white space from character fields returned from the database -->
			<property name="trimStrings" value="true" />
		</javaModelGenerator>

		<!-- It is used to define properties of the SQL map(.xml) generator. -->
		<sqlMapGenerator targetPackage="com.soul.dao"
			targetProject="./">
			<!-- If this property is true, the generated SQL Map for the table will be placed in the package "com.soul.dao.myschema" -->
			<property name="enableSubPackages" value="false" />
			<!--  trim the white space from character fields returned from the database -->
			<property name="trimStrings" value="true" />
		</sqlMapGenerator>

		<!-- It is used to define properties of the Java client generator -->
		<!-- XMLMAPPER : The interfaces will be dependent on generated XML mapper files.-->
		<javaClientGenerator type="XMLMAPPER"
			targetPackage="com.soul.dao" targetProject="./">
			<property name="enableSubPackages" value="false" />
		</javaClientGenerator>

		<!-- domainObjectname : The base name from which generated object names will be generated.-->
		<table schema="" tableName="SOUL_STUDENT" domainObjectName="student">
			<generatedKey column="SOUL_ID" sqlStatement="select SOUL_ID() FROM DUAL" identity="false" />
		</table>
	
</generatorConfiguration>


原文地址:https://www.cnblogs.com/aukle/p/3221707.html