-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当Mapper类中有重载方法的时候用jrebel启动报错,而禁用本插件之后用jrebel启动则正常 #24
Comments
明天验证下,不知道 |
使用 从源码中我们也可以知道 public V put(String key, V value) {
if (containsKey(key)) {
throw new IllegalArgumentException(name + " already contains value for " + key
+ (conflictMessageProducer == null ? "" : conflictMessageProducer.apply(super.get(key), value)));
}
if (key.contains(".")) {
final String shortKey = getShortName(key);
if (super.get(shortKey) == null) {
super.put(shortKey, value);
} else {
super.put(shortKey, (V) new Ambiguity(shortKey));
}
}
return super.put(key, value);
} |
是这样的,我使用的是github上的另外一个开源项目,项目地址是:https://github.com/YXJ2018/SpringBoot-Vue-OnlineExam ,我不使用jrebel启动,或者禁用本插件之后使用jrebel启动项目都是可以的,没有报任何错误。唯独在使用本插件之后,使用jrebel启动就报上面的错误了。楼主可下载该项目的后端代码在idea启动试一下就能看出来了。 |
下面是MybatisPlus重写的Configuration
/**
* MybatisPlus 加载 SQL 顺序:
* <p>1、加载XML中的SQL</p>
* <p>2、加载sqlProvider中的SQL</p>
* <p>3、xmlSql 与 sqlProvider不能包含相同的SQL</p>
* <p>调整后的SQL优先级:xmlSql > sqlProvider > curdSql</p>
*/
@Override
public void addMappedStatement(MappedStatement ms) {
logger.debug("addMappedStatement: " + ms.getId());
if (mappedStatements.containsKey(ms.getId())) {
/*
* 说明已加载了xml中的节点; 忽略mapper中的SqlProvider数据
*/
logger.error("mapper[" + ms.getId() + "] is ignored, because it exists, maybe from xml file");
return;
}
super.addMappedStatement(ms);
} 之所以关掉插件不报错,是因为这个类重写了 你关掉插件,启动项目应该会有类似的输出 |
我也遇到了这个问题 我的mp版本是3.5.2 |
看我上面的回答。 |
请问,是不修复这个问题吗,(虽然重载的写法本身就是坑) |
目前不打算修复哦 |
大佬,我尝试处理了下,处理完的结果是不会reload重载的xml,正常的xml正常relaod,不会导致项目起不来,直接贴代码,看大佬是否能采纳. |
示例代码:
报错内容:
The text was updated successfully, but these errors were encountered: