mybatis-generator-config工具的使用
generator.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用于设置数据库驱动包位置-->
</pre><pre code_snippet_id="485664" snippet_file_name="blog_20141016_1_6249858" name="code" class="html">
<classPathEntry location="F:\jar\mysql-connector-java-5.1.25\mysql-connector-java-5.1.25\mysql-connector-java-5.1.22-bin.jar"/>
<!-- targetRuntime:代码生成目标,默认是MyBatis3-->
<context id="DB2Tables" targetRuntime="MyBatis3">
<commentGenerator>
<property name="suppressAllComments" value="true"/>
</commentGenerator>
<!-- 数据库连接的信息 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/test" userId="root" password="root">
</jdbcConnection>
<!-- 解决数据转换问题 -->
<javaTypeResolver>
<!--是否强制使用BigDecimal来表示所有的十进制和数值字段。-->
<property name="forceBigDecimals" value="false" />
</javaTypeResolver>
<!--生成模型的包名和位置-->
<javaModelGenerator targetPackage="project.model" targetProject="E:\mybatis\src">
<property name="enableSubPackages" value="true" />
<property name="trimStrings" value="true" />
</javaModelGenerator>
<!--生成的映射文件包名和位置-->
<sqlMapGenerator targetPackage="project.mapping" targetProject="E:\mybatis\src">
<property name="enableSubPackages" value="true" />
</sqlMapGenerator>
<!--生成DAO的包名和位置-->
<javaClientGenerator type="XMLMAPPER" targetPackage="project.dao" targetProject="E:\mybatis\src">
<property name="enableSubPackages" value="true" />
</javaClientGenerator>
<!--要生成那些文件-->
<!--<table tableName="表名" domainObjectName="类名"></table>-->
<table tableName="t_user" domainObjectName="User" enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false"></table>
</context> </generatorConfiguration>
mybatis-generator-config工具的使用的更多相关文章
- Mybatis generator生成工具简单介绍
Mybatis generator 其主要的功能就是方便,快捷的创建好Dao,entry,xml 加快了开发速度,使用方面根据其提供的规则配置好就OK 这里还有一个重要的开发场景,开发过程中,对数据 ...
- Mybatis Generator生成工具配置文件详解
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...
- 【SSM 4】Mybatis逆向生成工具
在上一篇博客中说到,Mybatis是灵活的SQL语句应用,不想Hibernate一样有其封装好的方法,那么,当我们用Mybatis的时候(Hibernate),我们都需要编写其实体类,和配置文件.本篇 ...
- mybatis逆向工程(MyBatis Generator)
mybatis逆向工程(MyBatis Generator) 1. 什么是mybatis逆向工程 mybatis官方为了提高开发效率,提高自动对单表生成sql,包括 :mapper.xml.mappe ...
- Mybatis Generator的model生成中文注释,支持oracle和mysql(通过修改源码的方式来实现)
在看本篇之前,最好先看一下上一篇通过实现CommentGenerator接口的方法来实现中文注释的例子,因为很多操作和上一篇基本是一致的,所以本篇可能不那么详细. 首先说一下上篇通过实现Comment ...
- SpringBoot(十一):springboot2.0.2下配置mybatis generator环境,并自定义字段/getter/settetr注释
Mybatis Generator是供开发者在mybatis开发时,快速构建mapper xml,mapper类,model类的一个插件工具.它相对来说对开发者是有很大的帮助的,但是它也有不足之处,比 ...
- Mybatis generator代码生成
背景 项目中使用Mybatis做持久层框架,但由于开发成员水平不一,写dao的时候,各有各的偏好,有时候还会写出带sql注入漏洞的代码. 出现sql注入漏洞,一般是#和$的区别没弄明白: $ 直接把字 ...
- mybatis逆向工程总结工具类
逆向工程字面意思就是反向生成工程,和hibernate一样mybatis也有自己的逆向工程工具,hibernate的逆向生成我没有做过,不过我猜大概都已样,再说,hibernate的现在使用很少了,到 ...
- 实习小结(四)--- MyBatis Generator使用
第一次听闻MyBatis Generator插件很是惊讶,已经有这么便捷方式的工具通过数据库表来自动生成实体类,映射文件,接口以及帮助类,而且可以通过自己写方法来增加中文注释,遂来学习一波.首先先建一 ...
- MyBatis -- generator 逆向工程
一.引言 官网文档:http://www.mybatis.org/generator/index.html 通过使用官方提供的mapper自动生成工具,mybatis-generator-core-1 ...
随机推荐
- 如何让你的App适配iOS7?
随着苹果在2013年9月18日发布iOS7最新的系统以来,iOS各种设备升级到iOS7的数字就已经不断刷新记录.目前据外界统计iOS7设备装机量已经达到2.5亿部,已占iOS设备的64%.由此可见让自 ...
- HTML5离线缓存问题
HTML5离线缓存问题 1.应用程序缓存 什么是应用程序缓存(Application Cache)? HTML5 引入了应用程序缓存,这意味着 web 应用可进行缓存,并可在没有因特网连接时进行访问. ...
- Hibernate ManyToOne, OneToMany的理解
User to Group, Many to One的关系 Test Case 1: session.beginTransaction(); user.setGroup(group); session ...
- 蚁群算法简介(part3: 蚁群算法之更新信息素)
信息素的局部更新策略 每只蚂蚁在构造出一条从起点到终点的路径后,蚁群算法还要求根据路径的总长度来更新这条路径所包含的每条边上信息素的浓度(在旅行商问题中每座城市是图中的一个节点,城市两两间有一条边 ...
- 微信小程序-图片、录音、音频播放、音乐播放、视屏、文件
图片: wx.chooseImage(OBJECT) 从本地相册选择图片或使用相机拍照. OBJECT参数说明: 注:文件的临时路径,在小程序本次启动期间可以正常使用,如需持久保存,需在主动调用 wx ...
- 界面布局之表格布局TableLayout+TableRow
一.基础知识: TableLayout置底,TableRow在TableLayout的上面,而Button.TextView等控件就在TableRow之上, 另外,TableLayout之上也可以单独 ...
- /etc/xinetd.conf 和 /etc/xinetd.d/*【新网络服务配置】
http://blog.csdn.net/kelven2004/article/details/1701930 xinetd 是 inetd 的安全加强版,它内置了自己的 TCP wrapper, 可 ...
- C# 实现 Excel文件的数据导入
前台 <asp:FileUpload ID="fuFile" runat="server" /> 后台 public string GetExcel ...
- Android之mtk上传log
Android之mtk上传log 1,打开浏览器 2.输入地址http://eservice.mediatek.com/eservice-portal/login 3.输入用户名,密码 4.提eser ...
- jquery.select2 模糊查询
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <link re ...