MyBatis reverse engineering to remove the table name prefix

https://www.jianshu.com/p/e09d2370b796

https://blog.csdn.net/baidu_16757561/article/details/75071476

https://blog.csdn.net/littleboyandgirl/article/details/82285986

https://blog.csdn.net/isea533/article/details/42102297

https://www.jianshu.com/p/e09d2370b796
the mybatis-config.xml Detailed
https://blog.csdn.net/wsh596823919/article/details/80761911

Git Flow Integration
Free Mybatis plugin
MyBatis Log Plugin
MyBatis Xml Validator
Power Mode
mybatipse
Eclipser converts Eclipse launch configurations into IntelliJ IDEA configurations:
GsonFormat
Lombok plugin
https://www.jianshu.com/p/b44dad6266a3
https://gitee.com/nieqiurong/mybatis-log

Scene:
a file such as a table named t_user, you want to generate User beginning, not the beginning TUser files.

You need to download the 1.3.6 version of Generator-the mybatis
https://github.com/mybatis/generator/releases

Then change the configuration file

<table schema="" tableName="t_user"><domainObjectRenamingRule searchString="^T" replaceString="" /></table>


<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.6</version>





<table schema="" tableName="t_goods%"  enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="false" enableUpdateByExample="false">


    <!--  enableInsert="false"  enableUpdateByPrimaryKey="false" enableUpdateByExample="false"
            enableDeleteByPrimaryKey="false" enableDeleteByExample="false"  -->

            <!--enableCountByExample="false" enableDeleteByExample="false" enableSelectByExample="false" enableUpdateByExample="false" -->

            <!-- 指定对象名 domainObjectName="DeviceResponse" -->
            <!-- 属性非驼峰
            <property name="useActualColumnNames" value="true"/>
            -->

    <generatedKey column="id" sqlStatement="Mysql" identity="true"/>

earchString="^[^_]+",这个查找字符串就是使用正则表达式来匹配表的字段名

这个意思就是匹配,开头的任意个非下划线(_)的字符,也就是这种如:c_,abc_。。。等等 
    <columnRenamingRule searchString="^[^_]+" replaceString=""/>
    <domainObjectRenamingRule searchString="^T" replaceString="" />

             <!-- 属性去前缀
            <columnRenamingRule searchString="^c_" replaceString="" />
            -->
            <!-- 指定字段类型
            <columnOverride column="content" javaType="java.lang.String" jdbcType="VARCHAR" />
            -->


</table>

Guess you like

Origin www.cnblogs.com/antball/p/11577598.html