Record Class DatabaseConfiguration
java.lang.Object
java.lang.Record
io.bloviate.db.DatabaseConfiguration
- Record Components:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesgeneratorRegistry- optional registry of custom generator rules (by column-name pattern, vendor type name, or JDBCType), consulted between per-column overrides and thedatabaseSupportdefaults; may be nullseed- the base seed for reproducible generation; vary it for a different datasetcommitStrategy- how the engine commits inserted rows; defaults toCommitStrategy.connectionDefault()(autocommit untouched) when nullbulkLoadStrategy- how the engine orders fills relative to foreign-key dependencies; defaults toBulkLoadStrategy.ordered()(dependency-ordered) when null
public record DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed, CommitStrategy commitStrategy, BulkLoadStrategy bulkLoadStrategy)
extends Record
Configuration settings for database filling operations.
This record encapsulates all configuration parameters needed to control the database filling process, including batch sizes, row counts, database-specific support, and table-specific overrides.
The configuration supports:
- Global batch size for INSERT operations
- Default row count applied to all tables
- Database-specific support implementation
- Per-table configuration overrides
- An optional registry of custom generator rules
- A base seed for reproducible, controllable data generation
The seed makes a fill reproducible: the same schema filled with
the same seed always produces identical data, and changing the seed produces a different but
equally reproducible dataset. See
DatabaseUtils.columnSeed(Column, long) for how per-column seeds are
derived.
- Author:
- Tim Veil
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations) DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed) Creates a configuration with the given baseseedand no customGeneratorRegistry.DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed, CommitStrategy commitStrategy) Creates a configuration with the given baseseedandCommitStrategy, and no customGeneratorRegistry.DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed, CommitStrategy commitStrategy, BulkLoadStrategy bulkLoadStrategy) Creates a configuration with the given baseseed,CommitStrategyandBulkLoadStrategy, and no customGeneratorRegistry.DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry) DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed) Creates a configuration with a customGeneratorRegistryand baseseed, and the defaultCommitStrategy(preserves the original six-argument signature).DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed, CommitStrategy commitStrategy) Creates a configuration with a customGeneratorRegistry, baseseedandCommitStrategy, and the defaultBulkLoadStrategy(preserves the original seven-argument signature).DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed, CommitStrategy commitStrategy, BulkLoadStrategy bulkLoadStrategy) Normalizes a nullcommitStrategytoCommitStrategy.connectionDefault()and a nullbulkLoadStrategytoBulkLoadStrategy.ordered()so the back-compatible behavior applies whenever a caller does not specify them. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebatchSizerecord component.Returns the value of thebulkLoadStrategyrecord component.Returns the value of thecommitStrategyrecord component.Returns the value of thedatabaseSupportrecord component.longReturns the value of thedefaultRowCountrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thegeneratorRegistryrecord component.final inthashCode()Returns a hash code value for this object.longseed()Returns the value of theseedrecord component.tableConfiguration(String tableName) Retrieves the table-specific configuration for the given table name.Returns the value of thetableConfigurationsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed, CommitStrategy commitStrategy, BulkLoadStrategy bulkLoadStrategy) Normalizes a nullcommitStrategytoCommitStrategy.connectionDefault()and a nullbulkLoadStrategytoBulkLoadStrategy.ordered()so the back-compatible behavior applies whenever a caller does not specify them. -
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations) - Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overrides
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry) - Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesgeneratorRegistry- optional registry of custom generator rules; may be null
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed) Creates a configuration with the given baseseedand no customGeneratorRegistry.- Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesseed- the base seed for reproducible generation
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed, CommitStrategy commitStrategy) Creates a configuration with the given baseseedandCommitStrategy, and no customGeneratorRegistry.- Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesseed- the base seed for reproducible generationcommitStrategy- how the engine commits inserted rows; may be null for the default
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, long seed, CommitStrategy commitStrategy, BulkLoadStrategy bulkLoadStrategy) Creates a configuration with the given baseseed,CommitStrategyandBulkLoadStrategy, and no customGeneratorRegistry.- Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesseed- the base seed for reproducible generationcommitStrategy- how the engine commits inserted rows; may be null for the defaultbulkLoadStrategy- how the engine orders fills; may be null for the default
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed) Creates a configuration with a customGeneratorRegistryand baseseed, and the defaultCommitStrategy(preserves the original six-argument signature).- Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesgeneratorRegistry- optional registry of custom generator rules; may be nullseed- the base seed for reproducible generation
-
DatabaseConfiguration
public DatabaseConfiguration(int batchSize, long defaultRowCount, DatabaseSupport databaseSupport, Set<TableConfiguration> tableConfigurations, GeneratorRegistry generatorRegistry, long seed, CommitStrategy commitStrategy) Creates a configuration with a customGeneratorRegistry, baseseedandCommitStrategy, and the defaultBulkLoadStrategy(preserves the original seven-argument signature).- Parameters:
batchSize- the number of rows to include in each batch INSERT operationdefaultRowCount- the default number of rows to generate for each tabledatabaseSupport- the database-specific support implementationtableConfigurations- optional per-table configuration overridesgeneratorRegistry- optional registry of custom generator rules; may be nullseed- the base seed for reproducible generationcommitStrategy- how the engine commits inserted rows; may be null for the default
-
-
Method Details
-
tableConfiguration
Retrieves the table-specific configuration for the given table name.- Parameters:
tableName- the name of the table to find configuration for- Returns:
- the table configuration if found, or null if using defaults
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
batchSize
-
defaultRowCount
public long defaultRowCount()Returns the value of thedefaultRowCountrecord component.- Returns:
- the value of the
defaultRowCountrecord component
-
databaseSupport
Returns the value of thedatabaseSupportrecord component.- Returns:
- the value of the
databaseSupportrecord component
-
tableConfigurations
Returns the value of thetableConfigurationsrecord component.- Returns:
- the value of the
tableConfigurationsrecord component
-
generatorRegistry
Returns the value of thegeneratorRegistryrecord component.- Returns:
- the value of the
generatorRegistryrecord component
-
seed
-
commitStrategy
Returns the value of thecommitStrategyrecord component.- Returns:
- the value of the
commitStrategyrecord component
-
bulkLoadStrategy
Returns the value of thebulkLoadStrategyrecord component.- Returns:
- the value of the
bulkLoadStrategyrecord component
-