Class GeneratorPropertiesBuilder
- java.lang.Object
-
- pro.chenggang.project.reactive.mybatis.support.generator.properties.GeneratorPropertiesBuilder
-
public class GeneratorPropertiesBuilder extends Object
Generator properties builder- Version:
- 1.0.0
- Author:
- Gang Cheng
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGeneratorPropertiesBuilder.TargetConnectionBuilderThe target connection builder.static classGeneratorPropertiesBuilder.TargetLocationBuilderThe target location builderstatic classGeneratorPropertiesBuilder.TargetPackageBuilderThe target package builder.
-
Constructor Summary
Constructors Modifier Constructor Description protectedGeneratorPropertiesBuilder(MybatisDynamicCodeGenerator.Configurer configurer)GeneratorPropertiesBuilder(GeneratorProperties generatorProperties, MybatisDynamicCodeGenerator.Configurer configurer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GeneratorPropertiesbuild()Build GeneratorPropertiesGeneratorPropertiesBuildercolumnNameTrimPattern(String columnNameTrimPattern)The column name trim regex pattern Setting '^Sys' will replace the generated column name start with Sys available when table name is specificGeneratorPropertiesBuilderdefaultJavaTypeModifierClass(Class<? extends GeneratedJavaTypeModifier> defaultJavaTypeModifierClass)The default java type modifier classGeneratorPropertiesBuilderextendDynamicMapper(boolean extendDynamicMapper)Whether extend dynamic mapperGeneratorPropertiesBuildergenerateComment(boolean generateComment)Whether generate column commentGeneratorPropertiesBuildergenerateReturnedKey(boolean generateReturnedKey)Whether generate returned keyGeneratorPropertiesBuildergeneratorTypes(Set<GeneratorType> generatorTypes)The target generator typesGeneratorPropertiesBuildergeneratorTypes(GeneratorType... generatorTypes)The target generator typesGeneratorPropertiesBuilderlombokConfigs(Set<LombokConfig> lombokConfigs)The Lombok configsGeneratorPropertiesBuilderlombokConfigs(LombokConfig... lombokConfigs)The Lombok configsGeneratorPropertiesBuilderoverwrite(boolean overwrite)Whether overwrite generated fileGeneratorPropertiesBuildertableNames(String... tableNames)The target table names,if empty then generate all tablesGeneratorPropertiesBuildertableNames(Set<String> tableNames)The target table names,if empty then generate all tablesGeneratorPropertiesBuildertableNameTrimPattern(String tableNameTrimPattern)The table name trim regex pattern Setting '^Sys' will replace the generated table name start with Sys available when table name is specificGeneratorPropertiesBuilder.TargetConnectionBuildertargetConnectionBuilder()new target connection builderGeneratorPropertiesBuilder.TargetLocationBuildertargetLocationBuilder()new target location builderGeneratorPropertiesBuilder.TargetPackageBuildertargetPackageBuilder()new target package builderMybatisDynamicCodeGenerator.ConfigurerthenConfigurer()Then return Configure
-
-
-
Constructor Detail
-
GeneratorPropertiesBuilder
protected GeneratorPropertiesBuilder(MybatisDynamicCodeGenerator.Configurer configurer)
-
GeneratorPropertiesBuilder
public GeneratorPropertiesBuilder(GeneratorProperties generatorProperties, MybatisDynamicCodeGenerator.Configurer configurer)
-
-
Method Detail
-
generatorTypes
public GeneratorPropertiesBuilder generatorTypes(GeneratorType... generatorTypes)
The target generator types- Parameters:
generatorTypes- the generator types- Returns:
- the generator properties builder
-
generatorTypes
public GeneratorPropertiesBuilder generatorTypes(Set<GeneratorType> generatorTypes)
The target generator types- Parameters:
generatorTypes- the generator types- Returns:
- the generator properties builder
-
extendDynamicMapper
public GeneratorPropertiesBuilder extendDynamicMapper(boolean extendDynamicMapper)
Whether extend dynamic mapper- Parameters:
extendDynamicMapper- extend dynamic mapper or not- Returns:
- the generator properties builder
-
overwrite
public GeneratorPropertiesBuilder overwrite(boolean overwrite)
Whether overwrite generated file- Parameters:
overwrite- overwrite or not- Returns:
- the generator properties builder
-
generateReturnedKey
public GeneratorPropertiesBuilder generateReturnedKey(boolean generateReturnedKey)
Whether generate returned key- Parameters:
generateReturnedKey- generate returned key or not- Returns:
- the generator properties builder
-
generateComment
public GeneratorPropertiesBuilder generateComment(boolean generateComment)
Whether generate column comment- Parameters:
generateComment- generate comment or not- Returns:
- the generator properties builder
-
tableNameTrimPattern
public GeneratorPropertiesBuilder tableNameTrimPattern(String tableNameTrimPattern)
The table name trim regex pattern Setting '^Sys' will replace the generated table name start with Sys available when table name is specific- Parameters:
tableNameTrimPattern- the table name trim pattern- Returns:
- the generator properties builder
-
columnNameTrimPattern
public GeneratorPropertiesBuilder columnNameTrimPattern(String columnNameTrimPattern)
The column name trim regex pattern Setting '^Sys' will replace the generated column name start with Sys available when table name is specific- Parameters:
columnNameTrimPattern- the column name trim pattern- Returns:
- the generator properties builder
-
defaultJavaTypeModifierClass
public GeneratorPropertiesBuilder defaultJavaTypeModifierClass(Class<? extends GeneratedJavaTypeModifier> defaultJavaTypeModifierClass)
The default java type modifier class- Parameters:
defaultJavaTypeModifierClass- the default java type modifier class- Returns:
- the generator properties builder
-
lombokConfigs
public GeneratorPropertiesBuilder lombokConfigs(LombokConfig... lombokConfigs)
The Lombok configs- Parameters:
lombokConfigs- the lombok configs- Returns:
- the generator properties builder
-
lombokConfigs
public GeneratorPropertiesBuilder lombokConfigs(Set<LombokConfig> lombokConfigs)
The Lombok configs- Parameters:
lombokConfigs- the lombok configs- Returns:
- the generator properties builder
-
tableNames
public GeneratorPropertiesBuilder tableNames(String... tableNames)
The target table names,if empty then generate all tables- Parameters:
tableNames- the table names- Returns:
- the generator properties builder
-
tableNames
public GeneratorPropertiesBuilder tableNames(Set<String> tableNames)
The target table names,if empty then generate all tables- Parameters:
tableNames- the table names- Returns:
- the generator properties builder
-
targetLocationBuilder
public GeneratorPropertiesBuilder.TargetLocationBuilder targetLocationBuilder()
new target location builder- Returns:
- the target location builder
-
targetPackageBuilder
public GeneratorPropertiesBuilder.TargetPackageBuilder targetPackageBuilder()
new target package builder- Returns:
- the target package builder
-
targetConnectionBuilder
public GeneratorPropertiesBuilder.TargetConnectionBuilder targetConnectionBuilder()
new target connection builder- Returns:
- the target connection builder
-
build
protected GeneratorProperties build()
Build GeneratorProperties- Returns:
- the GeneratorProperties
-
thenConfigurer
public MybatisDynamicCodeGenerator.Configurer thenConfigurer()
Then return Configure- Returns:
- the configurer
-
-