zoukankan      html  css  js  c++  java
  • myEclipse mybatis自动生成工具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>
    <context id="ID " defaultModelType="flat">
    <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://地址:端口;DatabaseName=数据库名称" userId="用户名" password="密码" />
    <javaModelGenerator targetPackage="com.包名.entity.main" targetProject="存放项目名称" />
    <sqlMapGenerator targetPackage="com.包名.dao.main.mapping.sqlserver" targetProject="存放项目名称" />
    <javaClientGenerator targetPackage="com.包名.dao.main" targetProject="存放项目名称" type="XMLMAPPER" />
    <table tableName="表名称(与数据库同步)" enableCountByExample="flase" enableUpdateByExample="flase" enableDeleteByExample="flase" enableSelectByExample="flase" selectByExampleQueryId="flase"></table>
    </context>
    </generatorConfiguration>

    例子:

    <?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>
    <context id="sky" defaultModelType="flat">
    <jdbcConnection driverClass="com.microsoft.sqlserver.jdbc.SQLServerDriver" connectionURL="jdbc:sqlserver://192.168.0.66:1433;DatabaseName=database1" userId="admin" password="123sky3" />
    <javaModelGenerator targetPackage="com.sky.demo.other.entity.main" targetProject="demo-other-main" />
    <sqlMapGenerator targetPackage="com.sky.demo.other.dao.main.mapping.sqlserver" targetProject="demo-other-main" />
    <javaClientGenerator targetPackage="com.sky.demo.other.dao.main" targetProject="demo-other-main" type="XMLMAPPER" />
    <table tableName="u_student" enableCountByExample="flase" enableUpdateByExample="flase" enableDeleteByExample="flase" enableSelectByExample="flase" selectByExampleQueryId="flase"></table>
    </context>
    </generatorConfiguration>

  • 相关阅读:
    【转载】网站服务器运维记实:阿里云1核2G突发性能t5服务器突然变得卡顿
    【转载】C#中自定义Sort的排序规则IComparable接口
    【转载】C#将图片转换为二进制流调用
    【转载】ASP.NET MVC重写URL制作伪静态网页,URL地址以.html结尾
    Java通过反射机制修改类中的私有属性的值
    Android -- 分享功能和打开指定程序
    Java存储密码用字符数组
    java笔试题(3)
    Java中的String与常量池
    Android -- 距离感应器控制屏幕灭屏白屏
  • 原文地址:https://www.cnblogs.com/sky-zky/p/9540275.html
Copyright © 2011-2022 走看看