diff --git a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/EntityConfig.java b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/EntityConfig.java index c8dd9b96..6636419f 100644 --- a/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/EntityConfig.java +++ b/mybatis-flex-codegen/src/main/java/com/mybatisflex/codegen/config/EntityConfig.java @@ -66,19 +66,10 @@ public class EntityConfig { */ private SwaggerVersion swaggerVersion; - public enum SwaggerVersion { - FOX("FOX"), - DOC("DOC"); - private final String name; - - SwaggerVersion(String name) { - this.name = name; - } - - public String getName() { - return this.name; - } - } + /** + * Entity 是否启用 Active Record 功能。 + */ + private boolean withActiveRecord; /** * 实体类数据源。 @@ -207,6 +198,21 @@ public class EntityConfig { return this; } + /** + * 是否启用 Active Record。 + */ + public boolean isWithActiveRecord() { + return withActiveRecord; + } + + /** + * 设置是否启用 Active Record。 + */ + public EntityConfig setWithActiveRecord(boolean withActiveRecord) { + this.withActiveRecord = withActiveRecord; + return this; + } + /** * 获取实体类数据源。 */ @@ -222,4 +228,20 @@ public class EntityConfig { return this; } + public enum SwaggerVersion { + + FOX("FOX"), + DOC("DOC"); + private final String name; + + SwaggerVersion(String name) { + this.name = name; + } + + public String getName() { + return this.name; + } + + } + }