mybatis自动生成映射实体类

来源:互联网 发布:软件即征即退 编辑:程序博客网 时间:2024/03/29 16:42
<?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>  <!-- http://mbg.cndocs.tk/ api -->  <context id="context1">    <!-- 生成根配置文件(jdbc) -->    <jdbcConnection connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"       driverClass="oracle.jdbc.OracleDriver" password="tiger" userId="scott" />    <!-- 生成emp表的mybatis代码                        生成emp的实体类  将 表明当成类名   列名当成属性名    -->       <javaModelGenerator targetPackage="cn.et.mybatis.entity" targetProject="D:\aaa\src" />    <!--                          生成 接口映射的代码  java接口     -->    <sqlMapGenerator targetPackage="cn.et.mybatis.dao" targetProject="D:\aaa\src" />    <!--                        生成 xml或者注解     -->    <javaClientGenerator targetPackage="cn.et.mybatis.dao" targetProject="D:\aaa\src" type="XMLMAPPER" />    <!--                  方案 每个用户都有一个唯一的方案  方案名等于用户名     -->    <table schema="scott" tableName="emp" enableCountByExample="false"        enableSelectByExample="false" enableUpdateByExample="false"        enableDeleteByExample="false"     >    </table>  </context></generatorConfiguration>

阅读全文
0 0