MyBatis Generator安装及使用说明
来源:互联网 发布:python 字典列表排序 编辑:程序博客网 时间:2024/05/21 07:14
Mybatis Generator安装及使用
安装
1、下载mybatis-generator-eclipse插件。
2、解压,将features及plugins拷贝到eclipse对应目录下,重启eclipse。
3、file->new,出现MyBatis Generator Configuration File即表明generator安装成功。
使用
1、新建dynamic web project。
2、右键src,new ->source folder,main.resources;右键resources,new->package,com;右键src,new ->source folder,main.java。
3、右键com,new->MyBatis->MyBatis Generator Configuration File。
4、配置generatorConfig.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="context1">
<commentGenerator>
<!-- 是否去除自动生成的注释 .true:是 ;false:否 -->
<property name="suppressAllComments" value="true" />
</commentGenerator>
<!-- 数据库链接URL、用户名、密码 -->
<jdbcConnection connectionURL="jdbc:oracle:thin:@XXX.XXX.XXX.XXX:1521:xxx"
driverClass="oracle.jdbc.driver.OracleDriver" password="xxx"
userId="xxx" />
<!-- 生成模型的包名和位置 -->
<javaModelGenerator targetPackage="com.seal.machine.domain"
targetProject="MyBatisGenerator/src/main/java" />
<!-- 生成的映射文件报名和位置 -->
<sqlMapGenerator targetPackage="com.seal.machine.domain"
targetProject="MyBatisGenerator/src/main/java" />
<!-- 生成DAO的包名和位置 -->
<javaClientGenerator targetPackage="com.seal.machine.domain"
targetProject="MyBatisGenerator/src/main/java" type="XMLMAPPER" />
<!-- 要生成的表(更改tableName和domainObjectName即可) -->
<table schema="" tableName="SEAL_MACHINE" domainObjectName="SealMachine"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
</table>
</context>
</generatorConfiguration>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
5、向WEB-INF/lib下添加ojdbc.jar,build path。需要注意的是,oracle12需要使用ojdbc6-xxx.jar。
6、右键generatorConfig.xml,generate MyBatis/IBATIS Artifacts,即可看到生成的文件。
7、将生成的文件拷贝到目标项目,并按需进行修改。
- MyBatis Generator安装及使用说明
- mybatis-generator-core 使用说明
- mybatis-generator使用说明
- eclipse mybatis generator插件安装及使用
- 完整的Mybatis Generator使用说明
- eclipse中mybatis generator插件的安装及使用
- Mybatis Generator插件的手动安装及插件的使用
- eclipse中mybatis generator插件的安装及使用
- eclipse中mybatis generator插件的安装及使用
- eclipse中mybatis generator插件的安装及使用
- mybatis-generator 插件离线安装
- eclipse 安装MyBatis Generator 插件
- eclipse安装mybatis generator插件
- IDEA中安装MyBatis Plugins(Mybatis-Generator)插件及破解方法
- Eclipse MyBatis Generator插件安装【手动安装加在线安装】加报错及解决方案
- MyBatis Generator(MBG)DB2使用说明 LONG VARCHAR 字段
- MyBatis Generator(MBG)MySql使用说明 无符号字段
- MyBatis Generator(MBG)Oracle使用说明 公共同义词 LONG数据类型
- Linux切换用户
- py程序---password问题
- sed命令修改行
- 几个ReportViewer性能问题排查经历
- mybatis返回类型出错
- MyBatis Generator安装及使用说明
- vtk--format
- Spring MVC 国际化
- bootstrap-table初始化配置
- 手机端 调用输入法 上的搜索键 进行搜索的使用方法
- Java中 获取指定字符串在另一个字符串中出现的次数
- linq to xml操作XML
- Linux文件管理:文件和目录管理
- 复制复杂链表