generator 工具的使用
来源:互联网 发布:linux tomcat debug 编辑:程序博客网 时间:2024/05/21 14:40
<span style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; background-color: rgb(255, 255, 255);">mybatis generator eclipse插件的安装:</span><a target=_blank href="http://jingyan.baidu.com/article/9faa7231506ed8473c28cbee.html" style="font-family: 'Microsoft Yahei', 微软雅黑, arial, 宋体, sans-serif; background-color: rgb(255, 255, 255);">http://jingyan.baidu.com/article/9faa7231506ed8473c28cbee.html</a>
1:在D盘下新建文件夹generator-tool(随便哪个盘,名称随便),放如下3个文件,并新建文件夹src(名称随便)
generator.xml如下:
<span style="color: rgb(51, 51, 51);"><?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> <!-- 配置mysql 驱动jar包路径.用了绝对路径 --> <classPathEntry location="</span><span style="color:#ff0000;">D:\generator-tool\</span><span style="color:#333333;">mysql-connector-java-5.1.22-bin.jar" /> <context id="glodon_mysql_tables" targetRuntime="MyBatis3"> <!-- 为了防止生成的代码中有很多注释,比较难看,加入下面的配置控制 --> <commentGenerator> <property name="suppressAllComments" value="true" /> <property name="suppressDate" value="true" /> </commentGenerator> <!-- 注释控制完毕 --> <!-- 数据库连接 --> <jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://127.0.0.1:3306/</span><span style="color:#ff0000;">mybatis</span><span style="color:#333333;">?characterEncoding=utf8" userId="</span><span style="color:#ff0000;">zjm</span><span style="color:#333333;">" password="</span><span style="color:#ff0000;">root</span><span style="color:#333333;">"> </jdbcConnection> <javaTypeResolver > <property name="forceBigDecimals" value="false" /> </javaTypeResolver> <!-- 数据表对应的model 层 --> <javaModelGenerator targetPackage="com.glodon.model" targetProject="</span><span style="color:#ff0000;">D:\generator-tool\src</span><span style="color:#333333;">"> <property name="enableSubPackages" value="true" /> <property name="trimStrings" value="true" /> </javaModelGenerator> <!-- sql mapper 隐射配置文件 --> <sqlMapGenerator targetPackage="com.glodon.mapper" targetProject="</span><span style="color:#ff0000;">D:\generator-tool\src</span><span style="color:#333333;">"> <property name="enableSubPackages" value="true" /> </sqlMapGenerator> <!-- 在ibatis2 中是dao层,但在mybatis3中,其实就是mapper接口 --> <javaClientGenerator type="XMLMAPPER" targetPackage="com.glodon.dao" targetProject="</span><span style="color:#ff0000;">D:\generator-tool\src</span><span style="color:#333333;">"> <property name="enableSubPackages" value="true" /> </javaClientGenerator> <!-- 要对那些数据表进行生成操作,必须要有一个. --> <table schema="mybatis" tableName="</span><span style="color:#ff0000;">category</span><span style="color:#333333;">" domainObjectName="</span><span style="color:#ff0000;">Category</span><span style="color:#333333;">" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"> </table> </context></generatorConfiguration></span>2:在当前目录下运行命令行:按住shift+鼠标右键,点击“在此处打开命令窗口(W)”,输入:
java-jar mybatis-generator-core-1.3.2.jar-configfile generator.xml-overwrite 回车。
0 0
- generator 工具的使用
- mybatis generator 工具的使用
- MyBatis Generator工具的使用
- mybatis generator 工具的使用
- Mybatis-generator工具的使用
- mybatis-generator工具的使用
- mybatis-generator-tool工具的使用
- mybatis工具generator使用
- mybatis-generator-core工具使用
- 使用Mybatis Generator 工具逆向
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
- 位图字体生成工具Bitmap Font Generator的使用
- [Tools]位图字体生成工具Bitmap Font Generator的使用
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
- MyBatis入门教程(四):generator工具的使用
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
- 数据库逆向框架代码生成工具:MyBatis Generator的使用
- jQuery炫酷3D翻页式电子时钟特效
- 使用 Apache Lucene 搜索文本
- c++词汇表
- Tomcat的session
- 第五周程序阅读(3)
- generator 工具的使用
- C变量的直接引用与间接引用区别
- main函数中的两个参数
- 立体匹配算法
- <C++>istringstream, ostringstream, stringstream的用法
- 欢迎使用CSDN-markdown编辑器
- IOS SDK详解之拍照/相册(默认+自定义拍照界面)
- 键盘enter事件一个页面绑定多次
- 【leetcode】Binary Tree Traversal