Class DatabaseFiller

java.lang.Object
io.bloviate.db.DatabaseFiller
All Implemented Interfaces:
Fillable

public class DatabaseFiller extends Object implements Fillable
Main entry point for filling database tables with generated data.

The DatabaseFiller orchestrates the entire database filling process by:

  • Analyzing database metadata to discover tables, columns, and relationships
  • Building a dependency graph based on foreign key relationships
  • Using topological sorting to determine the proper fill order
  • Delegating individual table filling to TableFiller instances

The filling process respects foreign key constraints by ensuring parent tables are populated before their dependent child tables. Self-referencing tables are detected and logged as potential issues.

Example usage:

DatabaseConfiguration config = new DatabaseConfiguration(batchSize, recordCount, 
    databaseSupport, tableConfigs);
new DatabaseFiller.Builder(connection, config)
    .build()
    .fill();
Author:
Tim Veil
See Also:
  • Method Details

    • fill

      public void fill() throws SQLException
      Fills all tables in the database with generated data.

      This method performs the complete database filling workflow:

      1. Retrieves database metadata including tables, columns, and foreign keys
      2. Builds a directed graph representing table dependencies
      3. Performs topological sorting to determine fill order
      4. Fills each table in dependency order using TableFiller

      Progress and timing information is logged throughout the process. A visualization link for the dependency graph is also provided in the logs.

      Specified by:
      fill in interface Fillable
      Throws:
      SQLException - if any database operation fails during the filling process