springboot整合mybatisplus报错:Failed to process, please exclude the tableName or statementId错误


问题描述:

在service层调用mybatis-plus的自带的save方法时,报错:Failed to process, please exclude the tableName or statementId。

 

解决方法:

只要在mybatis-plus的配置文件中去掉解析链即可

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MybatisPlusConfigure {
    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        //List<ISqlParser> sqlParserList = new ArrayList<>();
        // 攻击 SQL 阻断解析器、加入解析链
        //sqlParserList.add(new BlockAttackSqlParser());
        //paginationInterceptor.setSqlParserList(sqlParserList);
        return paginationInterceptor;
    }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM