For the complete documentation index, see llms.txt. This page is also available as Markdown.

CLI Tools

Command-line tooling for debugging entity mapping generation

GenerateMappings

GenerateMappings is a standalone command-line tool for generating Hibernate .hbm.xml mapping files from your entity classes, without booting a full BoxLang application or web request. It's most useful for:

  • Debugging why an entity fails to generate a mapping, in isolation from your application's startup process

  • Pre-generating and committing .hbm.xml files to disk so you can set generateMappings = false in production (see Performance)

It runs the same MappingGenerator used internally at ORM startup, so its output matches what your application generates automatically.

Usage

Run it with both boxlang.jar and the bx-orm module jar on the classpath:

java -cp "boxlang.jar:bx-orm-1.6.8.jar" ortus.boxlang.modules.orm.cli.GenerateMappings --path models

This generates a {entityName}.hbm.xml file alongside each entity class file found under models.

Options

Option
Description

--path PATH

Required (repeatable). Relative path to a directory of entity files to scan. Pass it multiple times to scan more than one directory.

--mapping NAME:PATH

Registers a BoxLang module/directory mapping (equivalent to a runtime mapping) before scanning, so entity paths that reference it resolve correctly. Repeatable.

--failFast

Abort mapping generation on the first entity that fails to parse. Without this flag, unparseable entities are skipped (equivalent to ignoreParseErrors = true).

--debug

Enable debug-level logging for the orm log category.

Example

Last updated

Was this helpful?