Learn BxORM

Seventeen short lessons, from your first entity to a production boot, then five more to go further.

On this page

BxORM maps BoxLang classes to database tables. This course takes you from an empty folder to a small blog (users, posts and tags) running on BxORM, one short lesson at a time. Each lesson builds on the one before it and ends with a Try it section.

Your progress is remembered in this browser, so you can stop and pick up where you left off.

  1. Welcome to BxORMWhat an ORM does, what BxORM adds on top of Hibernate 7, and the blog you will build in this course.
  2. Install and configureInstall BxORM, point it at a database and run your first ORM script.
  3. Your first entityTurn a BoxLang class into a table with @persistent, then give it an id and typed properties.
  4. Save, load and deleteCreate users, save them, load them back by id or by a filter, change them and delete them.
  5. Static helpersLoad, find, count, create and bulk change entities straight from the class, like User::get( 1 ).
  6. RelationshipsConnect users, posts and tags with many-to-one, one-to-many and many-to-many relationships.
  7. Criteria queriesBuild queries in code with entityCriteria(): conditions, automatic joins, projections, paging and bulk changes.
  8. HQL, structs and queriesQuery with HQL, and turn entities into structs for a JSON API or into a query for reports.
  9. Transactions and the sessionCommit and roll back ORM work, see what changed before it is saved, lock rows and mix ORM with SQL safely.
  10. Events, soft delete and timestampsReact to inserts, updates and deletes, keep deleted posts in the table, and let BxORM stamp dates for you.
  11. Errors and observabilityRead and catch ORM errors, inspect the ORM with ormDiagnostics(), and watch your SQL in BxLens to find N+1 queries.
  12. Ship itProduction settings, the boot cache and the bxorm CLI for fast starts, and the second-level cache for fast reads.
  13. InheritanceShare columns with a mapped superclass, and model "kinds of" entities with single-table or joined inheritance.
  14. Testing ORM codeTest your entities and queries with TestBox, against a test database that resets itself, with every spec rolled back.
  15. BxORM with cbormUse BxORM inside a ColdBox app with cborm 6: entity services, virtual services, active entities and the same criteria builder.
  16. Building with AITeach your AI coding assistant how BxORM really works with the seven BxORM skills and the docs MCP server, then build a feature from a prompt.
  17. Coming from CFMLMove an existing CFML ORM app to BxORM: what carries over, which settings changed, and a step by step plan.

Before you start

You need:

  • BoxLang 1.x installed, with the boxlang and bx-module commands on your path.
  • A database you can create tables in. The lessons use MySQL, and every other database Hibernate supports works the same way.
  • A little BoxLang: variables, functions and classes.

The first twelve lessons are the essentials. Lessons 13 to 17 go further: inheritance, testing, cborm, building with AI and moving an existing CFML app. Take those in any order.

Every lesson links to the full BxORM documentation for the details it leaves out.

Edit this page Download Markdown Last updated Nov 23, 2026, 5:56:16 PM Report an issue