- <?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>
- <!-- Import configuration file -->
- <properties resource="init.properties"/>
- <!-- Specify the data connection driver jar address -->
- <classPathEntry location="${classPath}" />
- <!-- One database one context -->
- <context id="infoGuardian">
- <!-- comment -->
- <commentGenerator >
- <property name="suppressAllComments" value="false"/><!-- whether to uncomment -->
- <property name="suppressDate" value="true" /> <!-- Whether to generate a timestamp for comment generation-->
- </commentGenerator>
- <!-- jdbc connection -->
- <jdbcConnection driverClass="${jdbc_driver}"
- connectionURL="${jdbc_url}" userId="${jdbc_user}"
- password="${jdbc_password}" />
- <!-- type conversion -->
- <javaTypeResolver>
- <!-- Whether to use bigDecimal, false can automatically convert the following types (Long, Integer, Short, etc.) -->
- <property name="forceBigDecimals" value="false"/>
- </javaTypeResolver>
- <!-- Generate entity class address -->
- <javaModelGenerator targetPackage="com.oop.eksp.user.model"
- targetProject="${project}" >
- <!-- Whether to add a new layer of schema under the current path, eg: false path com.oop.eksp.user.model, true: com.oop.eksp.user.model.[schemaName] -->
- <property name="enableSubPackages" value="false"/>
- <!-- Whether to make a trim call when setting a field of type string -->
- <property name="trimStrings" value="true"/>
- </javaModelGenerator>
- <!-- Generate mapxml file -->
- <sqlMapGenerator targetPackage="com.oop.eksp.user.data"
- targetProject="${project}" >
- <!-- Whether to add a new layer of schema under the current path, eg: false path com.oop.eksp.user.model, true: com.oop.eksp.user.model.[schemaName] -->
- <property name="enableSubPackages" value="false" />
- </sqlMapGenerator>
- <!-- Generate mapxml corresponding client, which is interface dao -->
- <javaClientGenerator targetPackage="com.oop.eksp.user.data"
- targetProject="${project}" type="XMLMAPPER" >
- <!-- Whether to add a new layer of schema under the current path, eg: false path com.oop.eksp.user.model, true: com.oop.eksp.user.model.[schemaName] -->
- <property name="enableSubPackages" value="false" />
- </javaClientGenerator>
- <!-- Configuration table information -->
- <table schema="${jdbc_user}" tableName="s_user"
- domainObjectName="UserEntity" enableCountByExample="false"
- enableDeleteByExample="false" enableSelectByExample="false"
- enableUpdateByExample="false">
- <!-- schema is the database name tableName is the corresponding database table domainObjectName is the entity class to be generated enable*ByExample
- Whether to generate example class -->
- <!-- Ignore columns, do not generate bean fields -->
- <ignoreColumn column="FRED" />
- <!-- Specify the java data type of the column -->
- <columnOverride column="LONG_VARCHAR_FIELD" jdbcType="VARCHAR" />
- </table>
- </context>
- </generatorConfiguration>
- Attached to my init.properties
- #Mybatis Generator configuration
- project = EKSP
- classPath=E:/workplace/EKSP/WebContent/WEB-INF/lib/ojdbc14.jar
- jdbc_driver = oracle.jdbc.driver.OracleDriver
- jdbc_url=jdbc:oracle:thin:@127.0.0.1:1521:orcl
- jdbc_user=INFOGUARDIAN
- jdbc_password=info_idap132
MyBatis Generator generatorConfig.xml configuration details
Guess you like
Origin http://43.154.161.224:23101/article/api/json?id=325455071&siteId=291194637
Recommended
Ranking