mybatis generator eclipse插件的安装
2015-07-21 11:14
507 查看
目的:使用Spring+mybatis自动生成实体类,mapper.xml,mapper.java
方法:引入mybatisGenerator
操作:
1、下载mybatis generator eclipse插件离线包http://download.csdn.net/detail/gxl442172663/7624747#comment 。
2、将解压的features和plugins两个文件夹内文件复制到Eclipse安装目录对应的文件夹内。
3、重新启动Eclipse。
4、Eclipse中New–>Other–>MyBatis–>MyBatis Generator Configuration File
文件配置如下:
5、Eclipse中右键generatorConfigure.xml文件,执行性:Generate MyBatis /iBATIS Artifacts,即可生成对应文件。
6、参考链接:http://jingyan.baidu.com/article/9faa7231506ed8473c28cbee.html
方法:引入mybatisGenerator
操作:
1、下载mybatis generator eclipse插件离线包http://download.csdn.net/detail/gxl442172663/7624747#comment 。
2、将解压的features和plugins两个文件夹内文件复制到Eclipse安装目录对应的文件夹内。
3、重新启动Eclipse。
4、Eclipse中New–>Other–>MyBatis–>MyBatis Generator Configuration File
文件配置如下:
<?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:\user\681487\.m2\repository\mysql\mysql-connector-java\5.1.31\mysql-connector-java-5.1.31.jar"/> <context id="context1" > <commentGenerator> <property name="suppressDate" value="true"/> <!-- 是否去除自动生成的注释 true:是 : false:否 --> <property name="suppressAllComments" value="true"/> </commentGenerator> <!-- 数据库名称 账号 密码 驱动 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://10.118.46.20:3306/CONS" userId="mysql" password=""/> <!-- 生成实体类 实体bean文件 --> <javaModelGenerator targetPackage="com.sf.hbms.cons.domain" targetProject="HBMS-CONS" /> <!-- mapper xml文件 --> <sqlMapGenerator targetPackage="com.sf.hbms.cons.persistence" targetProject="HBMS-CONS" /> <!-- mapper 接口文件 --> <javaClientGenerator targetPackage="com.sf.hbms.cons.persistence" targetProject="HBMS-CONS" type="XMLMAPPER" /> <!-- 数据库的表 --> <table schema="ConsOrder" tableName="cons_order" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="OonsOrderOsyncresult" tableName="cons_order_asyncresult" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="ConsOrderDetail" tableName="cons_order_detail" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="ConsOrderPay" tableName="cons_order_pay" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="ConsOrderReqresp" tableName="cons_order_reqresp" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="ConsProducts" tableName="cons_products" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> <table schema="InThirdOrder" tableName="in_third_order" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table> </context> </generatorConfiguration>
5、Eclipse中右键generatorConfigure.xml文件,执行性:Generate MyBatis /iBATIS Artifacts,即可生成对应文件。
6、参考链接:http://jingyan.baidu.com/article/9faa7231506ed8473c28cbee.html
相关文章推荐
- 安装新jdk后,resin服务器项目不能启动问题
- velocity插件 veloeclipse 支持eclipse4.4
- java中堆和堆栈的区别及实例
- java小游戏之控制台下五子棋!
- JAVA中replace和replaceAll的区别
- Spring Batch系列总括
- Java Calendar 类的时间操作
- 把Java生成的RSA公钥、私钥转换成.NET使用的XML格式
- Spring配置JNDI加密用户名密码
- java_poi
- Java 策略设计模式
- java读取properties文件的六种方法
- Java基础语法(一)(标识符,关键字,注释,常量,变量,基本数据类型)
- 重学java23种设计模式-软件设计基本原则
- 饼状图形Factory
- 关于java多线程
- java发送邮件
- Java环境变量设置
- 11. JavaSE-Final关键字详解
- [LeetCode][Java] Path Sum II