admin管理员组

文章数量:1636810

环境:MyBatis Plus 3.2.0
报错:

Class ‘Anonymous class derived from FileOutConfig’ must implement abstract method ‘outputFile(TableInfo)’ in ‘FileOutConfig’

报错位置:

// 自定义输出配置
        List<FileOutConfig> focList = new ArrayList<>();
        // 自定义配置会被优先输出
        focList.add(new FileOutConfig(templatePath) {

            @Override
            public String outputFile(TableInfo tableInfo) {
                // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
                return projectPath + "/src/main/resources/mapper/" + pc.getModuleName()
                        + "/" + tableInfo.getEntityName() + "Mapper" + StringPool.DOT_XML;
            }
        });

原因:
TableInfo 引入错误,不是:com.baomidou.mybatisplus.core.metadata.TableInfo
而是:com.baomidou.mybatisplus.generator.config.po.TableInfo

本文标签: classAnonymousMyBatisgenerator