在table标签内添加

<columnRenamingRule searchString="wrc_" replaceString=""/>
<?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 location="D:/mysql-connector-java-5.1.40.jar" /> <context id="my" targetRuntime="MyBatis3"> <commentGenerator>
<property name="suppressAllComments" value="true" /><!-- 是否取消注释 -->
<property name="suppressDate" value="true" /> <!-- 是否生成注释代时间戳 -->
</commentGenerator>
<!-- 数据库连接信息 -->
<jdbcConnection driverClass="com.mysql.jdbc.Driver"
connectionURL="jdbc:mysql://127.0.0.1:3306/reptile?useUnicode=true&amp;characterEncoding=utf-8&amp;allowMultiQueries=true" userId="root"
password="123456" /> <!-- 只有一个属于forceBigDecimals,默认false。 如果字段精确超过0,生成BigDecimal 如果字段精确是0,总长度10-18生成Long;如果字段精确是0,
总长5-9生成Integer; 如果字段精确是0,总长小于5生成Short; 如果forceBigDecimals为true,统一生成BigDecimal -->
<javaTypeResolver>
<!-- 是否使用bigDecimal, false可自动转化以下类型(Long, Integer, Short, etc.) -->
<property name="forceBigDecimals" value="false" />
</javaTypeResolver> <!--生成Model.java文件 -->
<javaModelGenerator targetPackage="com.reptile.entity"
targetProject="src/main/java">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
<!-- 是否针对string类型的字段在set的时候进行trim调用 -->
<property name="trimStrings" value="true" />
</javaModelGenerator> <!-- 生成Mapper.xml文件 -->
<sqlMapGenerator targetPackage="mapper"
targetProject="src/main/resources">
<!-- enableSubPackages:是否让schema作为包的后缀 -->
<property name="enableSubPackages" value="false" />
</sqlMapGenerator> <!-- 生成Mapper.java文件,即dao层 -->
<javaClientGenerator type="XMLMAPPER"
targetPackage="com.reptile.mapper" targetProject="src/main/java">
<property name="enableSubPackages" value="false" />
</javaClientGenerator> <!-- 待生成的数据库中的表名,生成一个表对应的Java和xml文件就需要配置一段 -->
<table tableName="tb_weekly" domainObjectName="Weekly"
enableCountByExample="false" enableUpdateByExample="false"
enableDeleteByExample="false" enableSelectByExample="false"
selectByExampleQueryId="false">
<!--移除字段前缀-->
<columnRenamingRule searchString="wrc_" replaceString=""/>
</table> </context> </generatorConfiguration>

MyBatis Generator 移除字段前缀的更多相关文章

  1. 修改mybatis plus Generator模板生成字段注释枚举常量

    修改mybatis plus Generator模板生成字段注释枚举常量 本文基于最新的mybatis-plus 3.0.1版本源码修改,如果使用其它版本,处理方式也类似,主要是生成Entity的Fr ...

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

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

  3. mybatis generator如何定制JavaTypeResolver,使smallint类型的数据库字段在po中的类型为Integer?

    一.问题概述 忙了一段时间的jenkins持续集成,又要开始开发任务了.这两天在用mybatis generator来逆向生成dao层工程. 其中一个问题在于,组长在设计表的时候,不少枚举使用了sma ...

  4. mybatis generator为实体类生成自定义注释(读取数据库字段的注释添加到实体类,不修改源码)

    我们都知道mybatis generator自动生成的注释没什么实际作用,而且还增加了代码量.如果能将注释从数据库中捞取到,不仅能很大程度上增加代码的可读性,而且减少了后期手动加注释的工作量. 1.首 ...

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

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

  6. MyBatis Generator 详解

    MyBatis Generator中文文档 MyBatis Generator中文文档地址:http://mbg.cndocs.tk/ 该中文文档由于尽可能和原文内容一致,所以有些地方如果不熟悉,看中 ...

  7. MyBatis Generator 详解 【转来纯为备忘】

    版权声明:版权归博主所有,转载请带上本文链接!联系方式:abel533@gmail.com   目录(?)[+] MyBatis Generator中文文档 运行MyBatis Generator X ...

  8. mybatis generator使用总结

    一.mybatis项目的体系结构 百度mybaits,可以进入mybatis的github:https://github.com/mybatis. mybatis是一个大大的体系,它不是孤立的,它可以 ...

  9. mybatis Generator配置文件详解

    这里按照配置的顺序对配置逐个讲解,更细的内容可以配合中文文档参照. 1. 配置文件头 <?xml version="1.0" encoding="UTF-8&quo ...

随机推荐

  1. Windows Server 2019 SSH Server

    Windows Server 2019 SSH Server   在需要安裝的ws2019开启powershell,执行安装 openssh server 指令 Add-WindowsCapabili ...

  2. mysql注入语句

    一.sql注入语句 爆破所有数据库: (select group_concat(schema_name) from information_schema.schemata) 获取数据库所有表: (se ...

  3. layui 时间选择器 不要秒的选项

    通过修改 CSS 样式可以隐藏秒的选项 ++ .laydate-time-list{padding-bottom:0;overflow:hidden} .laydate-time-list>li ...

  4. [Nowcoder113E]弹球弹弹弹_线段树

    弹球弹弹弹 题目大意:有n个位置,标号为1到n的整数,m次操作,第i次操作放置一个弹球在b[i] xor c[i-1]处,并询问b[i] xor c[i-1]处弹球个数c[i]每次操作后,在x处的弹球 ...

  5. Navicat远程无法创建数据库

    Navicat远程无法创建数据库 提示报错信息如下,说明是用户创建的权限不足. Error Code: 1044. Access denied for user 'root'@'%' to datab ...

  6. llinux 进阶篇

    df 查看磁盘空间 df -h (加了之后就有单位了) free 指令,查看内存使用情况 free -m(表示一mb单位进行查看) head 查看一个文件的前n行,如果没有n 就默认为前10行 hea ...

  7. mysql在B-Tree上创建伪哈希索引

    构建哈希的过程 select过程 长字符串下,构建索引可通过自定义哈希作为索引,本人通过实验,在3百多个数据记录的下,性能效果很明显,完全不是一个等级.以下为索引前后几种情况对比 无索引的url:直接 ...

  8. 查看linux服务器信息

    1.  vmstat 查看服务器内存,CPU等信息 一般是通过两个数字参数来完成的,第一个参数是采样时间间隔,单位是秒, 第二个参数是采样的次数 r:    表示运行队列,如果队列过大说明CPU很繁忙 ...

  9. Web项目测试流程总结

    个人知识脑图总结 - 未完全(工作项目脑图总结存于网盘中)

  10. centos7安装配置NFS文件共享存储

    一,环境介绍    本实验使用了两台centos7虚拟机,其中         服务器:192.168.1.188    客户端:192.168.1.189 二,实验步骤    192.168.1.1 ...