myEclipse mybatis自动生成工具xml配置

Posted sky-zky

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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>





















以上是关于myEclipse mybatis自动生成工具xml配置的主要内容,如果未能解决你的问题,请参考以下文章

MyEclipse自动生成Ant Build.xm

Mybatis 代码自动生成[myeclipse版]

myeclipse2013 如何安装mybatis 插件 ?

开发工具:Mybatis.Plus.插件三种方式的逆向工程

generatorconfig.xml怎么填写

mybatis generator配置生成代码的问题