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 ...
随机推荐
- JavaScript(ES5)知识点梳理
数据类型(null undefined number string boolean object)数据类型之间的相互转化(Boolean Number String parseInt parseFlo ...
- Java处理微信公众号文章图片不显示微信
http://blog.csdn.net/just4you/article/details/52933620
- MongoDB数据库的基本操作
非关系型数据库(json数据库) npm install mongoose --save 启动数据酷: mongod --config /usr/local/etc/mongod.conf 这里可以将 ...
- 一些常见的第三方UI库
第三方UI库 1 bootstrap Bootstrap是Twitter推出的一个用于前端开发的开源工具包.它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个C ...
- VC_窗口exe_printf信息
1. #include <io.h> #include <fcntl.h> #include <stdio.h> 2. void InitConsoleWindow ...
- STL——vector
学到STL的vector,发现手中的材料不是很详细,这里做个汇总. 1 操作 (1)头文件#include<vector>. (2)创建vector对象,vector<int> ...
- 力扣(LeetCode)191. 位1的个数
编写一个函数,输入是一个无符号整数,返回其二进制表达式中数字位数为 '1' 的个数(也被称为汉明重量). 示例 1: 输入:00000000000000000000000000001011 输出:3 ...
- CentOS7 上安装 Lua5.3
1.CentOS7默认已经安装了5.1.4 ①查看当前lua版本号:lua -v Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio ②查看lua和 ...
- Linux中系统检测工具top命令
Linux中系统检测工具top命令 本文转自:https://www.cnblogs.com/zhoug2020/p/6336453.html 首先介绍top中一些字段的含义: VIRT:virtua ...
- 上传RNA-seq数据到NCBI GEO数据库
SRA - NCBI example - NCBI 要发文章了,审稿时编辑肯定会要求你上传NGS测序数据. 一般数据都是放在集群,不可能放在个人电脑上,因为有的数据大的吓人(几个T). 所以我们就建一 ...