关于使用MyBatis逆向工程生成器把其他数据库的同名表生成下来的问题(Table Configuration xxx matched more than one table (xxx,xxx))
在使用逆向工程生成类的时候,我遇到了把同名的其它数据库的类给生成下来了的问题。并且Idea也报Warning:
Table Configuration xxx matched more than one table (xxx,xxx)
在网上一番搜索后,找寻到了问题所在:
我们需要在“配置数据库连接信息”里面加上:
<property name="nullCatalogMeansCurrent" value="true"/>
完整的GeneratorMapper.xml代码:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE generatorConfigurationPUBLIC "-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN""http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd"><generatorConfiguration><!-- 指定连接数据库的JDBC驱动包所在位置,指定到你本机的完整路径 --><classPathEntry location="##############"/><!-- 配置table表信息内容体,targetRuntime指定采用MyBatis3的版本 --><context id="tables" targetRuntime="MyBatis3"><!-- 抑制生成注释,由于生成的注释都是英文的,可以不让它生成 --><commentGenerator><property name="suppressAllComments" value="true" /></commentGenerator><!-- 配置数据库连接信息 --><jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"connectionURL="jdbc:mysql://localhost:3306/##你的数据库名##"userId="root"password="123456"><property name="serverTimezone" value="Asia/Shanghai"/><property name="nullCatalogMeansCurrent" value="true"/></jdbcConnection><!-- 生成model类,targetPackage指定model类的包名, targetProject指定生成的model放在eclipse的哪个工程下面--><javaModelGenerator targetPackage="######"targetProject="######"><property name="enableSubPackages" value="false" /><property name="trimStrings" value="false" /></javaModelGenerator><!-- 生成MyBatis的Mapper.xml文件,targetPackage指定mapper.xml文件的包名, targetProject指定生成的mapper.xml放在eclipse的哪个工程下面 --><sqlMapGenerator targetPackage="######" targetProject="######"><property name="enableSubPackages" value="false" /></sqlMapGenerator><!-- 生成MyBatis的Mapper接口类文件,targetPackage指定Mapper接口类的包名, targetProject指定生成的Mapper接口放在eclipse的哪个工程下面 --><javaClientGenerator type="XMLMAPPER" targetPackage="######" targetProject="######"><property name="enableSubPackages" value="false" /></javaClientGenerator><!-- 数据库表名及对应的Java模型类名 --><table tableName="b_loan_info" domainObjectName="LoanInfo"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/><table tableName="b_bid_info" domainObjectName="BidInfo"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/><table tableName="b_income_record" domainObjectName="IncomeRecord"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/><table tableName="b_recharge_record" domainObjectName="RechargeRecord"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/><table tableName="u_user" domainObjectName="User"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/><table tableName="u_finance_account" domainObjectName="FinanceAccount"enableCountByExample="false"enableUpdateByExample="false"enableDeleteByExample="false"enableSelectByExample="false"selectByExampleQueryId="false"/></context></generatorConfiguration>
关于使用MyBatis逆向工程生成器把其他数据库的同名表生成下来的问题(Table Configuration xxx matched more than one table (xxx,xxx))相关推荐
- MyBatis Generator 生成器把其他数据库的同名表生成下来的问题
MyBatis Generator 生成器把其他数据库的同名表生成下来的问题 2018年10月23日 20:47:48 莫弹弹 阅读数:603 MyBatis Generator : Table Co ...
- MyBatis Generator:[WARNING] Table Configuration users matched more than one table
MyBatis Generator:[WARNING] Table Configuration users matched more than one table #在使用 MyBatis Gener ...
- 当mybatis逆向工程遇上了数据库字段增加
最近做的一个项目让我对mybatis的逆向工程有些迷茫,毕竟第一次在实际项目中使用,有太多稚嫩,老人路过还请指教. 对于mybatis的逆向工程,我既喜欢它让我省了很多力气,但是另一方面,它也给我套了 ...
- 【Mysql】更新多个数据库下同名表同名字段的长度
业务背景: 当前,我有多个同前缀的数据库(test前缀) 拥有该前缀的数据库里,都有一张right表 现在我们要把,test前缀数据库下的right表的字段name,长度变成1000. 实现SQL - ...
- IDEA版本的Mybatis逆向工程使用攻略
idea版本的Mybatis逆向工程开发(自动生成实体类层,mapper文件,dao层) 一.使用逆向工程开发概述 今天早上打算做一个spring+springmvc+mybatis的项目,然后感觉这 ...
- 逆向工程适配瀚高数据库
目录 环境 文档用途 详细信息 环境 系统平台:Microsoft Windows (64-bit) 10 版本:5.6.4 文档用途 在我们做项目中,关于持久层的生成相信是许多小伙伴头疼的事情.有没 ...
- php 清除数据表中所有数据库,清除一个数据库里所有表的数据
如果需要清除一个数据库里所有表的数据,则可用下面命令: exec sp_MSforeachtable TRUNCATE TABLE ? ******************************** ...
- MariaDB Spider 数据库分库分表实践
分库分表
分库分表 一般来说,数据库分库分表,有以下做法: 按哈希分片:根据一条数据的标识计算哈希值,将其分配到特定的数据库引擎中: 按范围分片:根据一条数据的标识(一般是值),将其分配到特定的数据库引擎中: ...
- 吃透Chisel语言.33.Chisel进阶之硬件生成器(二)——Chisel组合逻辑电路生成:以BCD编码表为例
Chisel进阶之硬件生成器(二)--Chisel组合逻辑电路生成:以BCD编码表为例 上一篇文章我们学习了两种类型的变量在Chisel之中的使用,然后分别介绍了Chisel中四种参数化的方法,对于我 ...
最新文章
- windows下rpc框架thrift的环境配置
- python urllib2 开启调试
- 为什么说重启能解决90%的问题
- 后台开发经典书籍--图解http
- ofstream与ate的故事
- HDU多校4 - 6808 Go Running(最小点覆盖+网络流优化)
- 牛客题霸 [输出二叉树的右视图] C++题解/答案
- android国籍组件,android组件化之路
- Java 画精美图形
- python也能写emoji表情?两个函数解决两者之间的联系
- 收入超10亿?罗永浩:要真有这个收入 我早就还完债做智能产品去了
- 小度回应天猫精灵:不要因为我们拿了第一就黑我们
- 如何编译Linux内核源码?
- 前端视频截图的方法canvas.drawImage()
- Ubuntu常用C语言IDE,Ubuntu下常用IDE的安装
- 手机连接电脑DCIM目录下文件夹和图片显示不全
- 二进制转八进制公式计算机,2进制转8进制(二进制转8进制公式)
- 配置localhost
- 无线通信与生活-(1)
- WEB测试番外之----XSS攻击