• mybatis generator with oracle


    1.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>
        <classPathEntry location="C:Users ocky.m2 epositorycomoracleojdbc611.2.0.1.0ojdbc6-11.2.0.1.0.jar" />

        <context id="MyBatis3" targetRuntime="MyBatis3">
            
            <jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@192.168.1.5:1521:MYDB"
                userId="rocky" password="rocky">
            </jdbcConnection>
            
            <javaModelGenerator targetPackage="com.myproject.rocky.web.model" targetProject="./src">
            </javaModelGenerator>

            <sqlMapGenerator targetPackage="com.myproject.rocky.web.dao" targetProject="./src">
            </sqlMapGenerator>

            <javaClientGenerator type="XMLMAPPER" targetPackage="com.myproject.rocky.web.dao"
                targetProject="./src">
            </javaClientGenerator>
        
            <table tableName="OBJ_USER" schema="rocky" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
        enableSelectByExample="false" selectByExampleQueryId="false">
                <property name="ignoreQualifiersAtRuntime" value="true" />
                <property name="runtimeTableName" value="OBJ_USER" />
                
            </table>
        </context>
    </generatorConfiguration>

    2.  mybatis-generator-core-1.3.2.jar

    3.  java -jar mybatis-generator-core-1.3.2.jar -configfile generator.xml -overwrite

    4. some problems:

       ~if the table short of primary key, you maynot generate the right mapper file and interface(only has the insert method).

     

     

  • 相关阅读:
    Django项目总结: REST Framework 用户注册登录,权限控制,级联操作查询,节流控制自定义
    画皮卡丘
    软件测试 (实际输出与预期输出间的比较过程)
    软件测试方法
    Vue模板语法
    HTTP 与 HTTPS 的区别
    tomcat运行多个项目同一个端口与不同端口的设置
    springboot-WebMvcConfigurer配置拦截器/跨域/格式化/注册控制器
    Spring IOC(控制反转)思想笔记
    工程师最重要的能力是什么?
  • 原文地址:https://www.cnblogs.com/rocky-fang/p/5310377.html
Copyright © 2020-2023  润新知