mybatis config 快速生成xml DAO

0.加jar包
1.a.BAT
java -jar E:\GZH\Mybaits\mybatis-generator-core-1.3.2\lib\mybatis-generator-core-1.3.2.jar -configfile E:\GZH\Mybaits\mybatis-generator-core-1.3.2\lib\generatorConfig.xml -overwrite
2.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>
<!-- 数据库驱动-->
<classPathEntry location="mysql-connector-java-5.1.25-bin.jar"/>
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressDate" value="true"/>
<!-- 是否去除自动生成的注释 true:是 : false:否 -->
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!--数据库链接URL,用户名、密码 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost/foen_zjt" userId="root" password="123456">
</jdbcConnection>
<javaTypeResolver>
<property name="forceBigDecimals" value="false"/>
</javaTypeResolver>
<!-- 生成模型的包名和位置-->
<javaModelGenerator targetPackage="main.java.com.foen.zjt.entity" targetProject="src">
<property name="enableSubPackages" value="true"/>
<property name="trimStrings" value="true"/>
</javaModelGenerator>
<!-- 生成映射文件的包名和位置-->
<sqlMapGenerator targetPackage="main.resources.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</sqlMapGenerator>
<!-- 生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="main.java.com.foen.zjt.mapping" targetProject="src">
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<!-- 要生成的表 tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<table tableName="web_link_info" domainObjectName="LinkInfoEntity" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
<table tableName="sys_log_info" domainObjectName="SysLogEntity" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context>
</generatorConfiguration>
mybatis config 快速生成xml DAO的更多相关文章
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (mysql)
1/自动生成的jar包:mybatis-generator-core-1.3.2.jar 2/generatorconfig.xml文件如: <?xml version="1.0& ...
- Mybatis 如何自动生成bean dao xml 配置文件 generatorconfig.xml (main()方法自动生成更快捷)
最近项目要用到mybatis中间件,中间涉及到要对表结构生成bean,dao,和sqlconfig.xml 所以记录一下学习过程 首先是准备工作,即准备需要的jar包:我们的数据库mysql,所以驱动 ...
- mybatis generate 自动生成 entity dao 和 xml 文件
其中的一种方式 ,使用maven 插件 <build> <plugins> <plugin> <groupId>org.mybatis.generato ...
- mybatis自己主动生成mapper,dao,映射文件
一.先创建数据脚本,这里用的mysql数据脚本 drop table VOTE_ITEM; drop table VOTE_OPTION; drop table VOTE_SUBJECT; drop ...
- python--利用列表推导式快速生成xml格式数据
在接口自动化测试中,我们经常将要发送的数据放到excel里. json数据放至excel方便,但最近的一个测试,数据是xml格式发送的 如下: 属性 必选/可选 描述 1. Message Eleme ...
- 生成XML文件,通过实体生成XML文件
实体 using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Xm ...
- Mybatis自动生成xml文件、dao接口、实体类
Mybatis可以通过逆向工程,实现自动生成xml文件.dao接口.实体类 以下使用的是Intellij Idea进行自动生成 一.首先,要在pom.xml中导入插件,在<build>中加 ...
- Mybatis generator自动生成代码包括实体,dao,xml文件
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...
- 使用MyBatis Generator自动生成实体、mapper和dao层
原文链接 通过MyBatis Generator可以自动生成实体.mapper和dao层,记录一下怎么用的. 主要步骤: 关于mybatis从数据库反向生成实体.DAO.mapper: 参考文章:ht ...
随机推荐
- c++读取utf-8格式中英文混合string
最近项目中用到需要给出每一个字在string中的索引,但是又因为中文字符跟英文字符长度不一样,得分开处理, 在这里记录一下. 想要达到的效果如下: 将 “测试3.1415engEng”分割开 代码: ...
- Web UI自动化测试基础——元素定位(一)
本篇文章整理了元素定位的基础知识——单个元素定位方式. 一.单个元素定位方式简介 1. find_element_by_id 通过元素的id属性进行定位.以百度首页为例,首先进入https://www ...
- LeetCode算法题-Most Common Word(Java实现)
这是悦乐书的第321次更新,第342篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第190题(顺位题号是819).给定一个段落和一组禁止词,返回不在禁止词列表中的最常用词 ...
- idea把java web项目打成war包
1.新建artifacts 2.设置你的目录内容路径 3.找到项目web或webapp的路径 4.可以直接添加已经跑通的项目 5.配置完成点OK 6.编译打成war包 7.点击编译结束打完收工 8.找 ...
- VS2017使用dotnet命令
添加引用Microsoft.EntityFrameworkCore.Tools 添加引用后提示未找到命令“dotnet ef”向csprog文件添加如下节点 <ItemGroup> < ...
- python下对mysql数据库的链接操作
参考网址: https://blog.csdn.net/guofeng93/article/details/53994112 https://blog.csdn.net/Chen_Eris/artic ...
- Redis进阶:Redis的主从复制机制
Redis进阶:Redis的主从复制机制 主从复制机制介绍 单机版的Redis存在性能瓶颈,Redis通过提高主从复制实现读写分离,提高了了Redis的可用性,另一方便也能实现数据在多个Redis直接 ...
- SpringBoot 单元测试junit test
pom引用 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http: ...
- keystone验证安装
以管理员的身份来请求鉴权的标识 keystone --os-tenant-name admin --os-username admin --os-password 123456 --os-auth- ...
- 码云与Git的使用
码云注册和使用 网址:https://gitee.com 注册之后新建一个仓库 接下来安装Git 协同开发Git安装与使用 下载地址:https://gitforwindows.org 安装完成之后选 ...