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工具的使用的更多相关文章

  1. Mybatis generator生成工具简单介绍

    Mybatis generator  其主要的功能就是方便,快捷的创建好Dao,entry,xml 加快了开发速度,使用方面根据其提供的规则配置好就OK 这里还有一个重要的开发场景,开发过程中,对数据 ...

  2. Mybatis Generator生成工具配置文件详解

    <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE generatorConfiguration ...

  3. 【SSM 4】Mybatis逆向生成工具

    在上一篇博客中说到,Mybatis是灵活的SQL语句应用,不想Hibernate一样有其封装好的方法,那么,当我们用Mybatis的时候(Hibernate),我们都需要编写其实体类,和配置文件.本篇 ...

  4. mybatis逆向工程(MyBatis Generator)

    mybatis逆向工程(MyBatis Generator) 1. 什么是mybatis逆向工程 mybatis官方为了提高开发效率,提高自动对单表生成sql,包括 :mapper.xml.mappe ...

  5. Mybatis Generator的model生成中文注释,支持oracle和mysql(通过修改源码的方式来实现)

    在看本篇之前,最好先看一下上一篇通过实现CommentGenerator接口的方法来实现中文注释的例子,因为很多操作和上一篇基本是一致的,所以本篇可能不那么详细. 首先说一下上篇通过实现Comment ...

  6. SpringBoot(十一):springboot2.0.2下配置mybatis generator环境,并自定义字段/getter/settetr注释

    Mybatis Generator是供开发者在mybatis开发时,快速构建mapper xml,mapper类,model类的一个插件工具.它相对来说对开发者是有很大的帮助的,但是它也有不足之处,比 ...

  7. Mybatis generator代码生成

    背景 项目中使用Mybatis做持久层框架,但由于开发成员水平不一,写dao的时候,各有各的偏好,有时候还会写出带sql注入漏洞的代码. 出现sql注入漏洞,一般是#和$的区别没弄明白: $ 直接把字 ...

  8. mybatis逆向工程总结工具类

    逆向工程字面意思就是反向生成工程,和hibernate一样mybatis也有自己的逆向工程工具,hibernate的逆向生成我没有做过,不过我猜大概都已样,再说,hibernate的现在使用很少了,到 ...

  9. 实习小结(四)--- MyBatis Generator使用

    第一次听闻MyBatis Generator插件很是惊讶,已经有这么便捷方式的工具通过数据库表来自动生成实体类,映射文件,接口以及帮助类,而且可以通过自己写方法来增加中文注释,遂来学习一波.首先先建一 ...

  10. MyBatis -- generator 逆向工程

    一.引言 官网文档:http://www.mybatis.org/generator/index.html 通过使用官方提供的mapper自动生成工具,mybatis-generator-core-1 ...

随机推荐

  1. UIScrollView,UIPageControl,UIImageView 实现图片轮播的效果

    上一篇博客介绍了如何将XCode创立的项目提交到Git版本控制,这次就直接做一个图片轮播的展示demo,刚好可以把UIScrollView.UIPageControl.UIImageView这三个控件 ...

  2. Spring MVC上传文件

    Spring MVC上传文件 1.Web.xml中加入 <servlet> <servlet-name>springmvc</servlet-name> <s ...

  3. command 'x86_64-linux-gnu-gcc' failed with exit status 1错误及解决方案

    Ubuntu16.04安装Scrapy(pip install Scrapy)时提示错误如下: Failed building wheel for cryptography Running setup ...

  4. java(2)之前往对象村

    这次说一说面向对象与面向过程的区别以及面向对象的优点.

  5. C# 委托实例(跨窗体操作控件)

    在C#里面却是可以不用自定义消息这么复杂的方法来实现跨窗体调用控件,C#有更好的办法就是委托. 效果描述:有两个窗体,FORM1(一个名为“打开form2”的button控件)和FORM2(一个名为“ ...

  6. My first blog in cnblog

    Learning, record and shareing. Being stronger.

  7. c# 无法加载 DLL xxxxxxxx找不到指定的模块。 (异常来自HRESULT:0x8007007E)。的一个解决方法

    最近在做一个程序,想把某些功能用C++写成DLL供C#调用.但是无法如何都无法调用,提示"无法加载 DLL xxxxxxxx找不到指定的模块. (异常来自HRESULT:0x8007007E ...

  8. 01 初识python

    python.exe -v / python3 -v安装python3时, 会得到一个 IDLE(提示符>>>), 简单, 有用, 包含语法编辑器(颜色可变), 调试工具, pyth ...

  9. Codeforces Round #267 (Div. 2)

    A #include <iostream> #include<cstdio> #include<cstring> #include<algorithm> ...

  10. iOS开发 点击某处横屏竖屏切换

    typedef NS_ENUM(NSInteger, UIInterfaceOrientation) { UIInterfaceOrientationUnknown            = UIDe ...