Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[错误报告]: 使用CodeGenerator代码生成器时通过enableChainModel 开启链式模型,实体中会增加@Accessors(chain = true)注解,我并不希望使用lombok #6675

Open
3 tasks done
zenghus opened this issue Jan 21, 2025 · 0 comments

Comments

@zenghus
Copy link

zenghus commented Jan 21, 2025

确认

  • 我使用的版本是最新版, 并且使用插件确认过项目里无依赖版本冲突
  • 我已经在 issue 中搜索过, 确认问题没有被提出过
  • 我已经修改标题, 将标题中的 描述 替换为遇到的问题

当前程序版本

3.5.10.1

问题描述

我在使用CodeGenerator代码生成器时并不希望使用Lombok相关配置,同时也需要entity在set属性时是链式模式,所以我设置了enableChainModel,

但是我发现我设置enableChainModel之后生成的entity会有@accessors(chain = true)注解,这个注解用的就是lombok的。
下面时我的CodeGenerator代码

 FastAutoGenerator.create(url, username, password)
        .globalConfig((scanner, builder) -> builder
                .author(scanner.apply("请输入作者名称?"))
                .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
                .commentDate("yyyy-MM-dd")
        )
        .packageConfig(builder -> builder
                .parent("cn.wanxue.base")
                .entity("entity")
                .mapper("mapper")
                .service("service")
                .serviceImpl("service.impl")
                .xml("mapper.xml")
        )
        .strategyConfig((scanner, builder) -> builder
                .addInclude(getTables(scanner.apply("请输入表名,多个英文逗号分隔?所有输入 all")))
                .controllerBuilder().disable()
                .entityBuilder()
                .enableChainModel()
                .addTableFills(
                        new Column("create_time", FieldFill.INSERT)
                )
                .build()
        )
        .templateEngine(new FreemarkerTemplateEngine())
        .execute();

### 详细堆栈日志

```bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant