mybatis generatorConfiguration.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>
<!-- 数据库驱动包位置 -->
<!-- <classPathEntry location="D:\generator\mysql-connector-java-5.1.34.jar" />  -->
<classPathEntry location="D:\app\HP\product\11.2.0\dbhome_1\jdbc\lib\ojdbc6.jar" />
<context id="DB2Tables" targetRuntime="MyBatis3">
    <commentGenerator>
        <property name="suppressAllComments" value="true" /><!-- 是否取消注释 -->
    </commentGenerator>
    <!-- 数据库链接URL、用户名、密码 -->
     <!-- <jdbcConnection driverClass="com.mysql.jdbc.Driver" 
  connectionURL="jdbc:mysql://localhots:3306/my_db?characterEncoding=utf8"
 userId="root" password="123456">  -->
    <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" 
        connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"
     userId="scott" password="rootroot">
    </jdbcConnection>
    <!-- 类型转换 -->
    <javaTypeResolver>
        <!-- 是否使用BigDecimals,false 可自动转换以下类型 (Long,Integer ,short,etc) -->
        <property name="forceBigDecimals" value="false" />
    </javaTypeResolver>
    <!-- 生成模型的包名和位置 -->
    <javaModelGenerator targetPackage="org.lq.entity" targetProject="mybatis11\src">
     <!-- 是否在当前路径下新加一层schema,eg:fase路径com.oop.eksp.user.model, true:com.oop.eksp.user.model.[schemaName] -->
        <property name="enableSubPackages" value="true" />
        <property name="trimStrings" value="true" />
    </javaModelGenerator>
    <!-- 生成的映射文件包名和位置 -->
    <sqlMapGenerator targetPackage="org.lq.mapping" targetProject="mybatis11\src">
        <property name="enableSubPackages" value="true" />
    </sqlMapGenerator>
    <!-- 生成DAO的包名和位置 -->
    <javaClientGenerator type="XMLMAPPER" targetPackage="org.lq.dao" targetProject="mybatis11\src">
        <property name="enableSubPackages" value="true" />
    </javaClientGenerator>
    <!-- 要生成那些表(更改tableName和domainObjectName就可以) -->
    <table tableName="dept" domainObjectName="Dept"
   enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" 
  enableSelectByExample="false" selectByExampleQueryId="false" />
    <table tableName="emp" domainObjectName="Emp"
   enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" 
  enableSelectByExample="false" selectByExampleQueryId="false" />
    <!-- <table tableName="course_info" domainObjectName="CourseInfo" 
  enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" 
  enableSelectByExample="false" selectByExampleQueryId="false" />
    <table tableName="course_user_info" domainObjectName="CourseUserInfo" 
  enableCountByExample="false" enableUpdateByExample="false"
 enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" /> -->
</context>
</generatorConfiguration>
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容