<!-- 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. Git在Eclipse中的使用

    一.把远程仓库的项目clone到eclipse里面: 最新版的Eclipse上已经集成了Git插件.所以在Eclipse中可以很方便的使用Git的功能. 在使用Git功能之前,需要先进行下简单的设置. ...

  2. Object.defineProperty的理解

    一.Object.defineProperty:给一个对象定义一个新的属性或修改一个对象现有的属性,并且返回这个对象 1.语法:Object.defineProperty(参数1,参数2,参数3) 参 ...

  3. GoldenGate for bigdata 12.3.1.1

    GoldenGate for big data 12.3.1.1在8.18已经发布,主要新特性如下: 1. 新目标:Amazon Kinesis 2. 新目标:使用Kafka Connect API及 ...

  4. Python基本数据类型——列表

    序列 序列是Python中的内置数据结构,常见的序列有:列表.字典.元组. 所有的序列都有自己的索引,程序可以通过索引来访问对应的值. 列表 list list是Python的一种最常见的内置数据类型 ...

  5. The POM for XXX is invalid, transitive dependencies (if any) will not be available解决方案

    今天,某个开发的环境在编译的时候提示警告The POM for XXX is invalid, transitive dependencies (if any) will not be availab ...

  6. c++ linux下输出中文

    同样,使用的是VS FOR LINUX进行测试. converting to execution character set: Invalid or incomplete multibyte or w ...

  7. py4CV例子2.5车牌识别和svm算法重构

    1.什easypr数据集:  ) ) ] all_label_list = temp[:, ] n_sample = , ) matcher = cv2.FlannBasedMatcher(flann ...

  8. Codeforces 827E Rusty String - 快速傅里叶变换 - 暴力

    Grigory loves strings. Recently he found a metal strip on a loft. The strip had length n and consist ...

  9. centos7 install rabbtimq

    yum install deltarpm erlang wget https://dl.bintray.com/rabbitmq/all/rabbitmq-server/3.7.8/rabbitmq- ...

  10. 5.sql2008分组与嵌套

    1.Group by基本介绍;2.Having的使用;3.分组综合应用;4.子查询基本介绍;5.In/Exists/Any/Some/All;6.子查询综合应用; 1.Group by基本介绍:依据B ...