Welcome to BxORM

What an ORM does, what BxORM adds on top of Hibernate 7, and the blog you will build in this course.

On this page

Most applications keep their data in a relational database: tables, rows and columns. Most application code thinks in objects: a user, a post, a tag. An ORM (object-relational mapper) connects the two. You describe a class once, and the ORM turns rows into objects when you load them and objects into rows when you save them.

BxORM is the ORM for BoxLang. It runs on Hibernate 7, the most widely used ORM on the JVM, and wraps it in a framework built for a dynamic language.

What BxORM adds on top of Hibernate

Hibernate on its own expects Java classes, XML mappings and a lot of casting. BxORM gives you:

  • Classes as tables. A BoxLang class with @persistent is an entity. No XML, no Java.
  • Generated methods. Getters, setters and relationship helpers like addPosts() are generated for you.
  • Static helpers. User::get( 1 ), User::findWhere( { email : "ann@example.com" } ) and User::count() on every entity.
  • A fluent criteria builder. Conditions, joins, projections and paging, always parameterized.
  • No casting. BoxLang values are converted to the right JDBC type and back.
  • Errors written for humans. A typo in an entity name says There is no entity named [Usr]. Did you mean [User]?
  • A boot cache. Large models start much faster in production.

Here is a taste. This loads a user, finds their published posts and turns them into JSON-ready structs:

ann   = User::getOrFail( 1 );
posts = Post::criteria()
    .isEq( "author", ann )
    .isTrue( "published" )
    .order( "createdDate", "desc" )
    .list();

println( entityToStruct( posts ) );

What you will build

Over the course you build a small blog with three entities:

EntityTableWhat it holds
UserusersAn email, a name and the user's posts
PostpostsA title, a body, a published flag, an author and tags
TagtagsA unique name

Every lesson adds to the same app, so keep the folder you create in the next lesson.

How the course works

The first twelve lessons are the essentials:

  1. Welcome (this lesson)
  2. Install and configure
  3. Your first entity
  4. Save, load and delete
  5. Static helpers
  6. Relationships
  7. Criteria queries
  8. HQL, structs and queries
  9. Transactions and the session
  10. Events, soft delete and timestamps
  11. Errors and observability
  12. Ship it

Then five lessons go further, in any order: inheritance, testing, cborm, building with AI and coming from CFML.

Try it

  • Think of an app you have built. Which of its tables would become entities?
  • Pick one table and list its columns. Which would be a plain property, and which point at another table?

Learn more

Edit this page Download Markdown Last updated Nov 23, 2026, 5:56:16 PM Report an issue
Lesson 1 of 17 - Learn BxORM