Mybatis自动生成实体类,映射文件,dao
http://www.mybatis.org/generator/index.html
方法一:eclipse插件式
1.下载 mybatis-generator-core-1.3.2.jar
解压后添加到eclipse插件

2.创建mybatis Generator配置文件
File→Other→Mybatis Generator Configuration File→选择路径→成功生成配置文件


3.配置配置文件
<?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 >
<!-- jar绝对路径 -->
<classPathEntry location="D:\zl\instantclient_11_264\ojdbc6.jar"/>
<context id="context1" >
<jdbcConnection driverClass="oracle.jdbc.driver.OracleDriver" connectionURL="jdbc:oracle:thin:@192.168.1.8:1521:rhhis" userId="tjglxt" password="tjglxt" />
<!-- 实体类生成后所在包和项目位置 -->
<javaModelGenerator targetPackage="cn.mode" targetProject="ssmAnnotation" />
<!-- 映射文件生成后所在包和项目位置 -->
<sqlMapGenerator targetPackage="cn.map" targetProject="ssmAnnotation" />
<!-- Dao生成后所在包和项目位置 -->
<javaClientGenerator targetPackage="cn.client" targetProject="ssmAnnotation" type="XMLMAPPER" />
<table tableName="ssmtest" >
<columnOverride column="id" property="id" />
<columnOverride column="name" property="name" />
<columnOverride column="age" property="age" />
</table>
</context>
</generatorConfiguration>
4.生成代码
在generator配置文件上右键→Generate MyBatis/IBATIS Artifacts→成功生成

Mybatis自动生成实体类,映射文件,dao的更多相关文章
- Mybatis自动生成实体类、dao接口和mapping映射文件
由于Mybatis是一种半自动的ORM框架,它的工作主要是配置mapping映射文件,为了减少手动书写映射文件,可以利用mybatis生成器,自动生成实体类.dao接口以及它的映射文件,然后直接拷贝到 ...
- Mybatis自动生成实体类和实体映射工具
Mybatis Mysql生成实体类 用到的Lib包: mybatis-generator-core-1.3.2.jarmysql-connector-java-5.1.30.jar 1. 创建一个文 ...
- Mybatis自动生成实体类
Maven自动生成实体类需要的jar包 一.pom.xml中 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns ...
- maven 工程mybatis自动生成实体类
generatorConfig.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE ge ...
- Jhipster自动生成实体类等文件
官网:https://www.jhipster.tech/cn/ 准备工作 安装node(npm) 准备jdl文件 安装Jhipster:npm install -g generator-jhipst ...
- mybatis generator配置,Mybatis自动生成文件配置,Mybatis自动生成实体Bean配置
mybatis generator配置,Mybatis自动生成文件配置,Mybatis自动生成实体Bean配置 ============================== 蕃薯耀 2018年3月14 ...
- Springboot mybatis generate 自动生成实体类和Mapper
https://github.com/JasmineQian/SpringDemo_2019/tree/master/mybatis Springboot让java开发变得方便,Springboot中 ...
- 使用MyBatis Generator自动生成实体、mapper和dao层
原文链接 通过MyBatis Generator可以自动生成实体.mapper和dao层,记录一下怎么用的. 主要步骤: 关于mybatis从数据库反向生成实体.DAO.mapper: 参考文章:ht ...
- 使用T4为数据库自动生成实体类
T4 (Text Template Transformation Toolkit) 是一个基于模板的代码生成器.使用T4你可以通过写一些ASP.NET-like模板,来生成C#, T-SQL, XML ...
随机推荐
- ssh中的 Connection closed by ***
另一台电脑的 mac/windows10/win7 都可以连接,就这台电脑不可以,但是能 ping 通, ssh 时总是 Connection reset by xxx 或 Connection cl ...
- Perl中命令行参数以及打开管道文件
打开管道文件 Linux提供了管道机制,可以方便应用程序之间的数据传递.在Perl中,扣开和使用管道可采用如下形式的open函数: open(Filehandle,”丨 CMD”); 其中 ...
- BioConda--转载
1. Conda安装 如BioConda官网[1]所说,BioConda需要Conda安装环境,如果你使用过Anaconda python安装环境,那么你已经有了Conda安装环境,否则,最好的办法是 ...
- phantomjs 下载
http://phantomjs.org/download.html
- Thymeleaf的基本语法总结
最近用Spring boot开发一些测试平台和工具,用到页面展示的部分, 选择的是thymeleaf模版引擎. 页面开发的7788快结束了,下面来总结下此过程中对thymeleaf的使用总结. 什么是 ...
- JavaSE习题 第六章 字符串和正则表达式
Make efforts eveyday 问答题 1.对于字符串 String s1=new String("ok"); String s2=new String("ok ...
- ORA-03113: end-of-file on communication channel(归档满处理方法)
归档放在flash_recovery目录,由于归档占满了闪回目录,数据库启动报错ORA-03113: end-of-file on communication channel tail -1200f ...
- ArrayList的详解
数组一旦给定大小就是固定的,只能放同类型的不能再改,还有一种高级的可扩充的,就是arrayList类,被称作动态数组或者集合. 使用步骤: 1. 引用命名空间system.collections: 2 ...
- Windows下的Python 3.6.1的下载与安装(适合32bits和64bits)(图文详解)
不多说,直接上干货! 为什么,这么简单的一个python,我还要特意来写一篇博客呢? 是因为留念下,在使用了Anaconda2和Anaconda3的基础上,现在需安装python3.6.0来做数据分析 ...
- bubbo调用Failed to invoke remote method异常解决
bubbo调用服务异常: com.alibaba.dubbo.rpc.RpcException: Failed to invoke remote method: getPlanFlowInfo, pr ...