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 ...
随机推荐
- WPF 带有提示文本的透明文本框
<TextBox Text="{Binding SearchInfo, UpdateSourceTrigger=PropertyChanged}" Grid.Row=&quo ...
- oracle data guard --理论知识回顾01
之前搭建了rac到单实例的dg环境,最近又在windows下搭建了dg,这一篇关于dg的一些理论知识回顾 官方文档 https://docs.oracle.com/cd/E11882_01/nav/p ...
- jeecg项目将workbook 的Excel流添加到zip压缩包里导出
1.直接献出代码 Map<String,List<ConfidentialInformation>> typeMap = new HashMap<>(); try ...
- 获取fork+exec启动的程序的PID值
问题背景 业务中有个场景需要自动起一个A程序(由于A程序与 sublime_text 启动后遇到的问题有相似之处,后文就用 sublime_text 来替代A程序,当A程序与 sublime_ ...
- android adb logcat获取日志文件
一般情况,可以直接在电脑终端上输入logcat来查看手机运行日志,但是测试工作者为了抓取日志文件来给开发人员,需要把日志导出到特定文件中.如下文. 以小米1s手机为例 步骤1:打开第一个终端窗口 ad ...
- linux工具之screen
screen官方网址:http://www.gnu.org/software/screen/ 参考文章:http://man.linuxde.net/screen 简介 Screen是一款由GNU计划 ...
- 【Qt笔记】QAction与QToolButton的关联
QAction可以理解为一个动作数据,包含了这个同坐相关的图标.文本.是否可用等数据和状态,以及连接对应的槽函数,用于执行这个动作. QToolButton则可以使用QAction对象作为后端,显示这 ...
- Luogu P5470 [NOI2019]序列
题目 可以直接贪心,但是用模拟费用流推的话会更轻松. 首先有一个显然的建图方式: \(S\)到\(0\)流量为\(k\),费用为\(0\). \(0\)到\(a_i\)流量为\(1\),费用为\(-a ...
- 图——图的Dijkstra法最短路径实现
1,最短路径的概念: 1,从有向图中某一顶点(起始顶点)到达另一顶点(终止顶点)的路径中,其权值之和最小的路径: 2,问题的提法: 1,给定一个带权有向图 G 与起始顶点 v,求从 v 到 G 中其它 ...
- loli的测试-2018.12.9
模拟赛-2018.12.9 这是NOIP之后第一次模拟赛...但是考的比较悲惨. 非常喜欢写考试总结,不知道为什么... T1:https://www.luogu.org/problemnew/sho ...