Class SchemaGenerator

java.lang.Object
com.onec.schema.SchemaGenerator

public class SchemaGenerator extends Object
Renders CREATE TABLE IF NOT EXISTS DDL for everything in the metadata registry. Table layouts come from SchemaModelBuilder, the shared source of truth also used by SchemaDiffEngine/SchemaUpgrader for evolving existing databases.

execute(Jdbi) is the simple bootstrap path: create what is missing, then add missing columns. For the full lifecycle (renames, type changes, history, destructive-change gating) use SchemaUpgrader.

  • Constructor Details

  • Method Details

    • generateSequenceTableDDL

      public static String generateSequenceTableDDL()
    • generateOutboxTableDDL

      public static String generateOutboxTableDDL()
    • generateDDL

      public List<String> generateDDL()
    • generateDDL

      public List<String> generateDDL(SqlDialect dialect)
    • execute

      public void execute(org.jdbi.v3.core.Jdbi jdbi)
    • generateIndexDDL

      public List<String> generateIndexDDL()
      Index statements for every generated table, covering the columns the framework itself queries by: ref columns (auto-joins and reference expansion), catalog hierarchy parents, document dates, tabular-section owners, register periods, document refs, and dimensions. Statements use IF NOT EXISTS and run after the additive column migration, so existing databases pick them up on next boot.
    • sqlType

      public static String sqlType(Class<?> javaType, int length, int precision, int scale)
    • sqlType

      public static String sqlType(Class<?> javaType, int length, int precision, int scale, String fieldContext)