4.3.1. Generator metadata

OrmFactory allows you to enrich your model with additional information that guides code generation. This extended information gives generators the context they need to produce accurate and consistent code across languages, ORMs, and coding styles. All changes are stored in the model and do not affect the database itself.

Override and Ignore

Override and Ignore fields let you customize how tables, columns, and foreign keys are represented in generated code.

  • Tables: Override class name, Override repository name, Ignore table
  • Columns: Override field name, Ignore field
  • Foreign Keys: Override field name, Override reverse field name

When an override is set, the generator uses it instead of automatically creating a name. Ignore flags exclude the table, column, or foreign key from code generation entirely.

The Watermark in each editable field shows a suggested name for the generator. If OrmFactory detects a single generator or all generators for a table share the same Naming Style Conversion, the watermark automatically reflects the converted name in the appropriate style (e.g., CamelCase or SCREAMING_SNAKE_CASE). This helps you see the expected generated name before applying any overrides.

Naming Style Conversion

Naming style conversion ensures consistent code style across different languages and generators.

  • Applied to both overridden and auto-generated names.
  • Supports styles like CamelCase, SCREAMING_SNAKE_CASE, and others.
  • Guarantees that generated code follows your preferred naming conventions without manual renaming.

Custom Parameters

Custom parameters are key-value pairs that provide extra hints to generators.

  • Available for tables and columns.
  • Can store any additional information required by a generator to produce code that fits your workflow.
  • Used to extend generator behavior without modifying the underlying model structure.

Named Rows

Named Rows are a mechanism to pass selected table rows into code generators.

  • Helps generate constants, enums, or object references in code.
  • Avoids magic numbers and ensures clarity and consistency.
  • Stored in the database, fetched during code generation, and inserted into the generator’s XML under the <Table> tag.

See the separate 4.3.2. Named Rows for a detailed explanation and examples.