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;
    }
}

 

posted @ 2020-09-23 17:10  xueheng_blog  阅读(8267)  评论(0)    收藏  举报