时间:2021-07-01 10:21:17 帮助过:33人阅读
二.自定义SQL注入器
@Component public class MyInjector extends DefaultSqlInjector { @Override public List<AbstractMethod> getMethodList(Class<?> mapperClass) { List<AbstractMethod> methodList = super.getMethodList(mapperClass); methodList.add(new MyMethod()); return methodList; } }
三.在你的Mapper类中添加刚才定义的method
@Repository public interface UserMapper extends BaseMapper<User> { int deleteAllData(); }
四.测试
@Test public void testInject(){ userMapper.deleteAllData(); }
运行结果:
mybtis plus 3.2.0 SQL注入器的配置
标签:sql config name mamicode injector sql注入 conf eal list