<!-- generatorConfig.xml配置,其中:<plugin type="org.mybatis.generator.plugins.ToStringPlugin" /> 可以直接将list返回值展示出来,而非地址-->
<?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>
<!-- 设置mysql驱动路径, 当使用cmd命令自动生成时,需要打开classPathEntry配置; 使用java类生成时,需要注释classPathEntry配置 -->
<!-- <classPathEntry location="./mysql-connector-java-5.1.27.jar" /> -->
<!-- 此处指定生成针对MyBatis3的DAO -->
<context id="context1" targetRuntime="MyBatis3">
<plugin type="org.mybatis.generator.plugins.SerializablePlugin" />
<plugin type="org.mybatis.generator.plugins.EqualsHashCodePlugin" />
<plugin type="org.mybatis.generator.plugins.ToStringPlugin" />
<plugin type="org.mybatis.generator.plugins.RenameExampleClassPlugin">
<property name="searchString" value="Example$" />
<property name="replaceString" value="Criteria" />
</plugin>
<!-- 去掉生成出来的代码的注解 -->
<commentGenerator>
<property name="suppressAllComments" value="true" />
<property name="suppressDate" value="true" />
</commentGenerator> <!-- jdbc连接信息 -->
<!-- jdbc:oracle:thin:@172.30.29.147:1521:orcl oracle.jdbc.OracleDriver -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://192.168.138.254:3306/jdd_user?characterEncoding=utf8" userId="root"
password="jdd.com" /> <!-- 默认false,表示把JDBC DECIMAL 和 NUMERIC 类型解析为 Integer; true表示把JDBC DECIMAL
和 NUMERIC 类型解析为java.math.BigDecimal -->
<javaTypeResolver>
<property name="forceBigDecimals" value="false" />
</javaTypeResolver> <!-- 生成bean对象 -->
<javaModelGenerator targetPackage="cn.springmvc.model"
targetProject="../ssm/src/main/java">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<!--<property name="enableSubPackages" value="true" /> -->
<!-- 从数据库返回的值被清理前后的空格 -->
<property name="trimStrings" value="true" />
</javaModelGenerator> <!-- 生成sqlMap xml -->
<sqlMapGenerator targetPackage="mapper"
targetProject="../ssm/src/main/resources" /> <!-- 生成DAO的类文件 -->
<javaClientGenerator targetPackage="cn.springmvc.dao"
targetProject="../ssm/src/main/java" type="XMLMAPPER">
<property name="enableSubPackages" value="true" />
</javaClientGenerator> <table tableName="user_base_info" domainObjectName="UserBaseInfo"></table> <!-- 想要生成的数据库表,自动化工具会根据该表的结构生成相应的bean对象 -->
<!-- <table tableName="content" domainObjectName="Content"></table>
<table tableName="content_pic" domainObjectName="ContentPic"></table>--> <!-- <table tableName="content_pic" domainObjectName="ContentPic"></table> -->
<!-- <table tableName="sinoicity_user" domainObjectName="User"></table>
<table tableName="sinoicity_dept" domainObjectName="Dept"></table> <table
tableName="sinoicity_function" domainObjectName="Function"></table> <table
tableName="sinoicity_role" domainObjectName="Role"></table> <table tableName="sinoicity_upmessage"
domainObjectName="Upmessage"></table> <table tableName="sinoicity_funcrole"
domainObjectName="Funcrole"></table> -->
</context>
</generatorConfiguration> <!-- 1.打开当前配置项classPathEntry 2.打开cmd,到含有mybatis-generator-core-1.3.2.jar的目录中,cd
D:\idea\webmailmanager\src\main\webapp\WEB-INF\lib 3.java -jar mybatis-generator-core-1.3.2.jar
-configfile D:\idea\webmailmanager\src\test\resources\generatorConfig.xml
-overwrite -->

MyBatis数据库测试代码自动生成的更多相关文章

  1. 基于数据库的代码自动生成工具,生成JavaBean、生成数据库文档、生成前后端代码等(v6.0.0版)

    TableGo v6.0.0 版震撼发布,此次版本更新如下: 1.UI界面大改版,组件大调整,提升界面功能的可扩展性. 2.新增BeautyEye主题,界面更加清新美观,也可以通过配置切换到原生Jav ...

  2. Mybatis最入门---代码自动生成(generatorConfig.xml配置)

    [一步是咫尺,一步即天涯] 经过前文的叙述,各位看官是不是已经被Mybatis的强大功能给折服了呢?本文我们将介绍一个能够极大提升我们开发效率的插件:即代码自动生成.这里的代码自动生成包括,与数据库一 ...

  3. Mybatis 代码自动生成(generatorConfig.xml配置)

    博客推荐: Mybatis最入门---代码自动生成(generatorConfig.xml配置) MyBatis Generator generatorConfig.xml配置详解 pom.xml&l ...

  4. Mybatis代码自动生成(含测试)

    一.建立数据库 create database shixun; use shixun; create table user( id int primary key auto_increment , u ...

  5. eclipse生成mybatis的逆向工程-mybatis代码自动生成

    首先,工作中一直在使用命令方式的mybatis的代码自动生成,今天把自己的笔记本直接搞一个在eclipse中生成的逆向代码生成工程,方便自己在家学习使用,在搞这个工程的过程中由于自己搞了一套环境,所i ...

  6. MyBatis代码自动生成

    MyBatis的代码自动生成的功能,由于MyBatis属于一种半自动的ORM框架,所以主要的工作就是配置Mapping映射文件,但是由于手写映射文件很容易出错,所以可利用MyBatis生成器自动生成实 ...

  7. 基于eclipse的mybatis映射代码自动生成的插件

    基于eclipse的mybatis映射代码自动生成的插件 分类: JAVA 数据库 工具相关2012-04-29 00:15 2157人阅读 评论(9) 收藏 举报 eclipsegeneratori ...

  8. 基于eclipse的mybatis映射代码自动生成的插件http://blog.csdn.net/fu9958/article/details/7521681

    基于eclipse的mybatis映射代码自动生成的插件 分类: JAVA 数据库 工具相关2012-04-29 00:15 2157人阅读 评论(9) 收藏 举报 eclipsegeneratori ...

  9. Spring Boot (七)MyBatis代码自动生成和辅助插件

    一.简介 1.1 MyBatis Generator介绍 MyBatis Generator 是MyBatis 官方出品的一款,用来自动生成MyBatis的 mapper.dao.entity 的框架 ...

随机推荐

  1. js相关(easyUI),触发器,ant,jbpm,hibernate二级缓存ehcache,Javamail,Lucene,jqplot,WebService,regex,struts2,oracle表空间

    *********************************************js相关********************************************* // 在指 ...

  2. tomcat2章1

    package ex02.pyrmont; import java.io.File; public class Constants { public static final String WEB_R ...

  3. [转载]WeeksInAYear、WeeksInYear、DaysInAYear、DaysInAMonth、DaysInYear、DaysInMonth - 获取指定年月的周、日数

    DateUtils.DaysInYear(); DateUtils.DaysInMonth(); DateUtils.DaysInAYear(); DateUtils.DaysInAMonth(); ...

  4. Spring IOC 和 AOP

    一. IOC 1. 概念及原理 IOC: Inversion of Control(控制反转)是一种设计思想,就是容器控制应用程序所需要的外部资源的创建和管理,然后将其反转给应用程序.对象及其依赖对象 ...

  5. hiho一下 第145周

    题目1 : 智力竞赛 时间限制:5000ms 单点时限:1000ms 内存限制:256MB 描述 小Hi.小Ho还有被小Hi强拉来的小Z,准备组队参加一个智力竞赛.竞赛采用过关制,共计N个关卡.在第i ...

  6. 【javascript】对原型对象、原型链的理解

    原型对象,原型链这些知识属于基础类知识.但是平时开发过程中也很少用到. 看网上的意思,原型链用于es5开发场景下的继承.es6有了类语法糖之后,就自带继承了. 通过理解,个人画了一张原型链解构的关系图 ...

  7. js输出

    JavaScript 可以通过4种不同的方式在html页面输出数据 1.使用window.alert() 弹出警告框,由于window为js的内置类,可简写为alter() <script> ...

  8. Vue小案例 之 商品管理------为之前的页面修改样式

    最终修改的页面效果: 修改的css: <style> #container{ margin: auto; text-align: center; width: 1000px; border ...

  9. 运行android模拟器,emulator: ERROR: x86 emulation currently requires hardware acceleration!

    运行android模拟器,emulator: ERROR: x86 emulation currently requires hardware acceleration! 问题: 运行android模 ...

  10. mongodb三种引擎测试(转)

    文章http://diyitui.com/content-1459560904.39084552.html亲测了根据证券行情存储的性能情况,我们目前使用load local infile,平均每秒更新 ...