mybatis-generator生成多次重复代码问题以及解决,
分享于 点击 36611 次 点评:249
mybatis-generator生成多次重复代码问题以及解决,
目录
- mybatis-generator生成多次重复代码
- 原因
- 解决方案
- 总结
mybatis-generator生成多次重复代码
原因
xxx:3306的MySQL服务里,有多个数据库。
不同数据库里面的表名相同,导致互相影响,重复生成
Tips:哪怕在url里面配置了数据库名,依然会重复
解决方案
在mapper-generator-config.xml文件中增加如下配置
<!--生成对应表及类名--> <table tableName="表名" domainObjectName="BrandAndProject" enableCountByExample="false" enableSelectByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" catalog="数据库名"> <property name="useActualColumnNames" value="false"></property> <property name="ignoreQualifiersAtRuntime" value="true"></property> </table>
最关键的就是catalog属性:
指定你想要 逆向工程代码 的 表
所在的数据库名
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持3672js教程。
您可能感兴趣的文章:- MyBatis Generator ORM层面的代码自动生成器(推荐)
- 基于mybatis-plus-generator实现代码自动生成器
- mybatis-generator-gui根据需求改动示例
- SpringBoot整合mybatis-generator插件流程详细讲解
- SpringBoot如何整合mybatis-generator-maven-plugin 1.4.0
- mybatis-generator-gui 工具使用(图形化工具)
- MyBatis代码自动生成器Mybatis-Generator的使用详解
用户点评