<!-- 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. EF使用sql语句

    https://www.cnblogs.com/chenwolong/p/SqlQuery.html https://blog.csdn.net/zdhlwt2008/article/details/ ...

  2. How to solve the problem that BMW Icom A2 A3 host can’t be connected?

    Aftre the BMW ICOM host is connected to the car via a 16PIN connector, and the other side is connect ...

  3. sparkStreaming插入mysql 必须考虑到实时更新老的key

    原先使用批次提交更新 但数据库无变化,不得不一条一条的插入 公司数据量不大  还未做数据量大的测试 但实时更新是可以的 关键sql : insert into area_user_amt (date, ...

  4. js 显示刚刚上传的图片 (onchange事件)

    <table> <tr width="100"> <td>上传商场图片:</td> <td> <input typ ...

  5. 算法笔记 #007# Backtracking

    留着备用. 题目描述和代码参考:https://www.geeksforgeeks.org/8-queen-problem/ NQueenProblem(js代码): class NQueenProb ...

  6. How to click on a point on an HTML5 canvas in Python selenium webdriver

    https://stackoverflow.com/questions/29624949/how-to-click-on-a-point-on-an-html5-canvas-in-python-se ...

  7. rsync 同步文件如何指定属主属组和权限

    rsync daemon 同步数据时,若想同时指定权限和属主属组,可以做如下配置: [test1] uid = admin gid = admin incoming chmod = Dug=rwx,D ...

  8. sqlloader parallel调用报ORA-26002: table has index defined upon it.解决方法

    ORA-26002: table has index defined upon it. This issue is caused when using the bulk load option in ...

  9. Installing Moses on Ubuntu 16.04

    Installing Moses on Ubuntu 16.04 The process of installation To install requirements sudo apt-get in ...

  10. python简说(十一)os模块

    import osres = os.listdir('/Users/nhy/Desktop') #列出某个目录下的所有文件# os.remove()# os.rename()# os.mkdir(r' ...