mysql逻辑删除的区别_不能和逻辑删除一起配置,不然报错。
源自:8-1 SQL注入器簡介及自定義方法實(shí)現(xiàn)
不能和邏輯刪除一起配置,不然報(bào)錯(cuò)。
邏輯刪除的配置:@Bean
public?ISqlInjector?sqlInjector(){
return?new?LogicSqlInjector();
}
mySqlInjector的配置:@Component
public?class?MySqlinjector?extends?DefaultSqlInjector?{
@Override
public?List?getMethodList(Class>?mapperClass)?{
//調(diào)用super的方法,否則mybatisplus的默認(rèn)方法都不能用
List?methodList?=?super.getMethodList(mapperClass);
//加入自定義的方法
methodList.add(new?RemoveById());
return?methodList;
}
}
報(bào)錯(cuò):
No qualifying bean of type 'com.baomidou.mybatisplus.core.injector.ISqlInjector' available: expected single matching bean but found 2: mySqlinjector,sqlInjector
提問者:慕粉1469371404
2019-11-26 15:54
總結(jié)
以上是生活随笔為你收集整理的mysql逻辑删除的区别_不能和逻辑删除一起配置,不然报错。的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用ado直接连接mysql_使用ADO
- 下一篇: 怎么把电脑的系统删除怎么恢复出厂设置 电