Blog

Luis Majano

December 01, 2026

Spread the word


Share your thoughts

πŸŽ‰ The biggest release in the history of BoxLang's ORM is here. BxORM 2.0 leaps from Hibernate 5.6 straight to Hibernate ORM 7.4, and cborm 6 lands with it, rebuilt on the new engine. This has been a very ambitious project, especially re-architecting the entire framework to adapt for the newest versions of Hibernate, JPA and the future.

The best part? You change nothing. Your entities, your entityNew() and entitySave() calls, your HQL and your persistent CFCs just keep working. Everything under them got a rebuild:

  • 🧬 BxORM is no longer a wrapper. It's a whole framework built on Hibernate, extending it at more than a dozen points.
  • ⚑ It's more efficient, and the boot cache cuts large-model startup about in half.
  • 🧯 It's error friendly and polished. When something goes wrong, it tells you exactly what to do next.

And it has a new home: bxorm.boxlang.io, with all the new what's new docs: https://bxorm.ortusbooks.com/bxorm-2.x/release-history/whats-new-2.0.0

TL;DR

  • πŸ›‘οΈ Zero code changes: your BIF calls, entities and HQL run as they are on Hibernate 7.4.
  • πŸš€ Hibernate 7.4: the modern query engine, current dialects and years of fixes. Hibernate 5 is end of life (Adobe|Lucee). BoxLang is not.
  • 🧬 Hibernate, extended considerably: generated entity classes, our own transaction coordinator, a BoxCache-backed second-level cache, case-insensitive HQL, named SQL functions and more.
  • ⚑ More efficient: a boot cache that cuts large-model startup in half, paging that never loads duplicates, projections that skip entity loading, and one shared connection per transaction.
  • 🧯 Error friendly and polished: typed orm.* errors with the fix in the detail and "Did you mean" suggestions.
  • πŸ“¦ cborm 6: the ColdBox ORM module, rebuilt on BxORM 2 with the same services, ActiveEntity and finders you know.
  • πŸ”Ž Criteria queries, static methods, entities as structs, soft delete, timestamps, vetoable events: built in, no plugins.
  • 🌐 A brand new website, the 2.0 docs as the default, a free 17-lesson course and 7 AI agent skills.

πŸ›‘οΈ Zero Code Changes

This is the part we care about most. Moving two major versions of Hibernate is normally a project. Here it is a dependency bump. 😎

Where BxORM and cborm users land: BxORM 2.0 and cborm 6 on BoxLang, cborm 5.x for Adobe ColdFusion

  • entityNew(), entitySave(), entityLoad(), ormExecuteQuery() and the rest of the BIFs behave as before.
  • Your entities, relationships and annotations map the same way.
  • Old dialect names like MySQL57 and Hibernate 5 dialect classes still work. They map to the current dialect with a one-time warning.
  • Your old ehcache.xml is still read and mapped to the new cache.
  • Persistent CFCs from CFML carry over.

We don't ship what we don't run. Every 2.0 build is tested against our own apps, ForgeBox, ContentBox, TimeBox and many more. TimeBox runs its full 1,171-spec suite on each one, in both auto and trust boot modes, and ForgeBox runs its CI on it. BxORM itself runs more than 900 specs in CI on every change, against MySQL and PostgreSQL.


🌐 A New Home: bxorm.boxlang.io

BxORM now has its own website at bxorm.boxlang.io, built with BoxLang's own static site generator, bx-sites.

It's the fastest way to see what BxORM is and why it matters:

  • The architecture at a glance. A diagram shows what you write (plain BoxLang), what BxORM does (mapping generation, generated entity classes, type conversion, case-insensitive HQL, transactions, events, caching, errors, the boot cache, observability) and the Hibernate 7.4 engine underneath.
  • Live code tours of static helpers, criteria queries and type conversion, side by side with what they return.
  • The boot chart, with real measured boot times for the boot cache.
  • BxLens screens, showing every ORM query, flush and failure in your app.
  • A five-minute Quick Start that goes from an empty app to your first saved row.
  • Every database Hibernate supports: MySQL, MariaDB, PostgreSQL, SQL Server, Oracle, SQLite, H2, CockroachDB and more.
  • The BoxLang family: ColdBox, CommandBox, BxLens, bx-sites and the rest of the ecosystem, one click away.

πŸŽ“ Learn BxORM: a free course

The site comes with Learn BxORM, a free course of 17 short lessons. Every lesson ends with code you can run.

The essentialsGoing further
1. Welcome13. Inheritance
2. Install and configure14. Testing
3. Your first entity15. cborm
4. Save, load and delete16. Building with AI
5. Static helpers17. Coming from CFML
6. Relationships
7. Criteria queries
8. HQL, structs and queries
9. Transactions
10. Events and soft delete
11. Errors and observability
12. Ship it

The first twelve take you from your first entity to a production boot. The last five go further.

πŸ€– Your coding agent already knows BxORM

We wrote seven agent skills that teach Claude Code, Copilot, Cursor, Codex and friends how BxORM 2 really works. They cover entities and annotations, relationships, querying, criteria, transactions, configuration and the boot cache, and observability. Install them in one line:

# Any agent
npx skills add ortus-boxlang/skills/boxlang-modules/bx-orm

# ColdBox CLI
coldbox ai skills install ortus-boxlang/skills/boxlang-modules/bx-orm/

# Claude Code
claude plugin marketplace add ortus-boxlang/skills
claude plugin install boxlang-agent-skills@boxlang-agent-skills

The docs also have their own MCP server, so your agent can read them live:

coldbox ai mcp add name=bxorm url=https://bxorm.ortusbooks.com/~gitbook/mcp

Browse every BoxLang skill at skills.boxlang.io.

πŸ“š The 2.0 docs are now the default

The BxORM docs now open on 2.0. They're rewritten from top to bottom and include:

  • What's New in 2.0.0 and a step-by-step upgrade guide from Hibernate 5 to Hibernate 7.
  • A migration guide for persistent CFCs coming from CFML.
  • Full chapters on criteria queries, transactions (with diagrams for each scenario), caching, observability, performance, and errors and diagnostics.

The 1.x docs stay available for apps still on 1.x.


πŸš€ From Hibernate 5.6 to Hibernate 7.4

BxORM 1.x ran on Hibernate 5.6. BxORM 2.0 runs on Hibernate ORM 7.4.8.Final, two major versions later. Hibernate 5 is end of life, and we won't leave our community on an engine that isn't supported. That means:

  • Hibernate's modern query engine. HQL is parsed into a typed query tree before it becomes SQL, so you get more expressive HQL and better error reporting.
  • Current database dialects for today's MySQL, MariaDB, PostgreSQL, SQL Server, Oracle and the rest.
  • Years of performance work, bug fixes and security updates.
  • Modern mappings. Entities map through Hibernate's mapping.xml format, handed to Hibernate in memory (savemapping : true writes them beside each entity if you want to look).

🧬 Not a Wrapper: How BxORM Extends Hibernate

Hibernate was built for static Java classes, XML mappings and typed parameters. BoxLang is dynamic. Closing that gap meant going deep into Hibernate's extension points, and we went further than any CFML or BoxLang ORM has before. Here is what's under the hood in 2.0:

Architecture: your BoxLang code, cborm 6, the BxORM 2.0 extension points and Hibernate ORM 7.4

Hibernate extension pointWhat BxORM does with it
Generated entity classesEach BoxLang entity get's dynamically compiled into our own Java classes
Entity representation strategy and instantiatorsHibernate creates, reads and writes your BoxLang objects directly.
Transaction coordinatorORM work rides BoxLang's own transaction{}. ORM writes and queryExecute() commit and roll back together on the same connection.
Connection providerHibernate uses your BoxLang datasources, with no separate pool or configuration.
JCache cache managerThe second-level cache runs on BoxCache: every cache region is a BoxLang cache, distributed providers included.
Attribute convertersA converter on every property turns BoxLang values into JDBC types and back. No casting.
Query functionsYou can now even register named SQL functions you register once and call by name from HQL and criteria.
HQL pre-processingCase-insensitive HQL: from user where firstname = ? finds User.firstName.
Integrators and event listenersEntity events, vetoes, postNew and postCommit.
Statement inspector and session listenersObservability events for every statement and flush, plus getSQL() on criteria queries.
Naming strategiesYour table and column naming rules, applied in BoxLang.

All of this is invisible to you. You write a class with @persistent and get the full power of Hibernate 7.

⚑ Why it's also more efficient

Extending Hibernate is not about showing off. Every extension point removes work from your app and your database:

  • One connection, one transaction. ORM and plain SQL share the same JDBC connection, so there is no second pool to size and no split commit to reason about.
  • Entities are created and read directly. No proxy objects or copy steps between Hibernate and your BoxLang classes.
  • Paging that counts entities, not rows. A condition on a collection matches each entity once through an id subquery, so a page of 25 is 25 entities, with no duplicates to filter out in memory.
  • Structs without entities. entityLoadAsStruct() and criteria asStruct() build structs straight from projection queries and never load an entity.
  • Read-only loads for reports and exports skip dirty checking.
  • A boot cache so production starts without parsing a single entity (details below).
  • Typed conversion once, in the converter, not in your code on every call.

Ideas from Grails GORM, cborm and mementifier, Built In

If you've used Grails GORM, cborm or mementifier, you know how good an ORM feels when it's built for a dynamic language. We took the best of those ideas and built them into the module itself. No plugins, no base classes, no service layer. Then we kept going.

Every entity is its own repository

At startup, every entity class gets static methods. Each one is the BIF you already know, with the entity name filled in:

var user   = User::getOrFail( id );
var admins = User::findAllWhere( { role : "admin" } );
var total  = User::count( { active : true } );

Queries that read like sentences

entityCriteria() is a fluent query builder with automatic joins, subqueries, projections, paging and streaming. It uses cborm's method names, so your cborm code reads the same.

var page = entityCriteria( "User" )
    .isEq( "status", "active" )
    .like( "role.name", "admin%" )
    .order( "lastName" )
    .paginate( page = 2, maxRows = 25 );

You can call functions inside property paths (isEq( "year(createdDate)", 2025 )), run bulk updateAll() and deleteAll(), and print the exact SQL with getSQL(). A condition on a collection now matches each entity once through an id subquery, so paging counts entities and works with json, text and CLOB columns on every database.

Entities as structs, mementifier-style

entityToStruct() turns entities into structs for APIs and views. It follows mementifier's this.memento conventions: includes, excludes, mappers, defaults and profiles. entityLoadAsStruct() and criteria asStruct() build the same structs straight from projection queries, without loading a single entity.

return entityToStruct( user, { includes : "roles.name" } );

Modeling, batteries included

@persistent
@softDelete
class {
    @fieldtype( "id" )
    @generator( "native" )
    property id;

    @ormtype( "timestamp" )
    @autoTimestamp( "create" )
    property createdDate;

    @ormtype( "timestamp" )
    @autoTimestamp( "update" )
    property updatedDate;
}
  • Soft delete: entityDelete() marks the row deleted, and every load skips it.
  • Automatic timestamps on create and update.
  • Entity where filters, unique keys and indexes, default sort order, and optimistic and pessimistic locking.
  • Read-only loads for reports and exports.
  • Load-or-create, load-or-fail, batch loads by id, references without a SELECT, and entity inspection BIFs.

Events you can veto

A preInsert, preUpdate or preDelete handler that returns false cancels the operation. postNew fires from entityNew(). And postCommit fires only once a write is committed, never for a rolled-back one. That makes it the right place to send emails or clear caches.


πŸ“¦ cborm 6: The ColdBox ORM Module, Rebuilt on BxORM 2

cborm 6 is the next generation of the ColdBox ORM module, and it ships with this release. It is a pure BoxLang module that sits directly on BxORM 2 and Hibernate 7. The services, ActiveEntity, dynamic finders, the entityService WireBox DSL, population, validation, the resource handler and the ColdBox interception points all keep the same methods and arguments. Your ColdBox app keeps working and picks up everything above.

property name="userService" inject="entityService:User";

var admins = userService
    .newCriteria()
    .isTrue( "isActive" )
    .joinTo( "role" )
        .isEq( "name", "admin" )
    .asStruct()
    .list();

What's new

  • Built on BxORM criteria. newCriteria() returns a BxORM entityCriteria() builder that keeps cborm's method names, adds c.restrictions, quantified subqueries and the SQL log, and relays criteria events to your ColdBox interceptors.
  • New service methods. findWhereOrFail(), firstOrNew(), firstOrCreate(), updateWhere(), getReference(), lock() and readOnly(). Finders and get() calls take an options struct passed straight to BxORM (readOnly, lock, uniqueFirst and more).
  • A new ORMPostCommit interception point. It fires once an insert, update or delete is committed, so it is the right place for emails, cache clears and webhooks.
  • Transactions that just work. Service transactions and the HibernateTransaction aspect ride BoxLang's transaction{}, and save(), delete() and saveAll() flush every datasource their entities belong to.
  • Composite ids work with exists(), getAll( id ) and deleteByID(), and dynamic finders accept id properties.
  • Error friendly. Dynamic finders rethrow BxORM's typed orm.* errors, "Did you mean" suggestions included, instead of wrapping them.
  • Safer and leaner. Bulk deletes flush pending changes first, UniqueValidator uses an EXISTS query and supports composite ids, and asStream = true returns a Java Stream read from the database as it is consumed. We also closed an HQL injection path in getAll( sortOrder ) and finder sortBy.
  • Fewer dependencies. cbstreams and cbpaginator are no longer required.

Turn on the one event handler and you're set:

this.ormSettings = {
    eventHandling : true,
    eventHandler  : "cborm.models.EventHandler"
};

What to check when you upgrade

cborm 6 removes the wrappers around Hibernate's old criteria API, because that API no longer exists in Hibernate 7. If you called into those internals, such as getNativeCriteria(), createSubcriteria() or the SQLHelper methods, there is a one-to-one replacement for each. The cborm 6 upgrading guide lists every one in a before and after table. If you stayed on the service layer, ActiveEntity and finders, you are done.

cborm 6 requires BoxLang 1.18.0+ with bx-orm 2 and ColdBox 8+. CFML apps run through bx-compat-cfml.

🧭 Still on Adobe ColdFusion?

We control our own engine, and we keep it on a supported, modern foundation. We don't control Adobe's, and Adobe still ships Hibernate 5, which is end of life. cborm 6 is BoxLang only. Adobe apps stay on cborm 5.x, which we keep supporting, and can move to BoxLang when they're ready. Because BxORM 2 needs no code changes and runs your persistent CFCs, that move is the easy part. You can also download our BoxLang Migration assistant and migrate easily: https://www.ortussolutions.com/blog/introducing-the-boxlang-migration-assistant-the-easy-button-from-adobe-coldfusion-lucee-to-boxlang


🧯 Errors Written for Humans

Hibernate's stack traces are written for Hibernate engineers. BxORM's errors are written for you. πŸ’š Every error BxORM raises is an orm.* typed exception. The message uses your entity and property names, the detail tells you how to fix it, and misspelled names get a suggestion:

try {
    entityLoad( "Usr" );
} catch ( "orm.entity.notFound" e ) {
    // There is no entity named [Usr]. Did you mean [User]?
}

You catch errors by type, not by parsing messages. The same errors surface through cborm's finders and criteria, and ormDiagnostics() reports the ORM's state for your application at any time.

⏱️ Start Production Without Parsing a Single Entity

The boot cache saves everything BxORM works out at startup (the resolved model and the generated entity classes) in a .bxorm/ folder. In production, trust mode boots straight from it.

this.ormSettings = {
    entityPaths : [ "models" ],
    ormManifest : "trust" // "auto" in development
};

The bxorm CLI builds the cache with no server, no database and no app start (boxlang module:orm generate), which is perfect for Docker images and CI. It also inspects, validates and clears the cache.

Median boot times in seconds, from the Performance docs:

Median boot times for off, auto and trust modes against BxORM 1.7.1 at 25 and 250 entities

EntitiesoffautotrustBxORM 1.7.1
255.235.103.863.13
25013.4814.147.128.46

On a large model, trust cuts boot time by about half, and at 250 entities it boots faster than 1.x did on Hibernate 5. Small apps pay a fixed cost of a second or two for Hibernate 7's larger runtime, in every mode.

In auto mode, BxORM also watches your entity files and reloads the ORM on the next request after you edit one.

πŸ” Transactions That Just Work

ORM work inside transaction{} now uses the same JDBC connection as queryExecute(). BoxLang owns the commit and the rollback, so ORM writes and plain SQL succeed or fail together.

ORM writes and queryExecute share one JDBC connection inside transaction{}, committing or rolling back together

BxORM also flushes pending ORM writes before any query in the transaction runs, whether it's an ORM query or plain SQL (queryExecute(), bx:query, qb). Save an entity, then update it with SQL in the same transaction, and the update finds the row:

transaction {
    entitySave( order );
    // Sees the order saved above, then commits together with it
    queryExecute( "UPDATE orders SET status = 'paid' WHERE id = :id", { id : order.getId() } );
}

πŸ—„οΈ Second-Level Cache on BoxCache

The second-level cache now runs on BoxLang's own BoxCache. Every cache region is a BoxLang cache. You can tune all of them at once or each one on its own with cacheConfig, point a region at any cache you define in boxlang.json (distributed providers included), and cache collections with cacheUse. Your old ehcache.xml is still read and mapped.

this.ormSettings = {
    secondaryCacheEnabled : true,
    cacheConfig           : { maxObjects : 1000, regions : { "countries" : { defaultTimeout : 0 } } }
};

πŸ”Ž See Every Query

BxORM announces its activity as BoxLang events, so tools can watch it without reaching into Hibernate:

  • onORMQuery after every SQL statement, with the SQL, timing, row count, datasource and entity.
  • onORMFlush with insert, update and delete counts, and onORMException for failures.
  • generateStatistics : true for Hibernate statistics.

Install BxLens (BoxLang+) and you get all of it on screen: every ORM statement, flush and failure per datasource, plus N+1 detection.

🏁 Get Started

Install the module and your JDBC driver:

box install bx-orm bx-mysql

Using ColdBox? Add cborm 6:

box install cborm

Turn on the ORM in Application.bx:

this.ormEnabled  = true;
this.ormSettings = {
    entityPaths : [ "models" ],
    dbcreate    : "update" // development only
};

Write your first entity:

@persistent
@table( "users" )
class {
    @fieldtype( "id" )
    @generator( "native" )
    property id;

    property firstName;
    property lastName;

    @unique
    property email;
}

And use it:

transaction {
    var ann = entityNew( "User", { firstName : "Ann", lastName : "Lee", email : "ann@example.com" } );
    entitySave( ann );
}

var lees = User::findAllWhere( { lastName : "Lee" } );

The Quick Start walks you through it in five minutes.

Upgrading?

  • From BxORM 1.x: your BIF calls keep working. Read Upgrading to 2.0.0 for the few behavior changes to check.
  • From cborm 5: services, ActiveEntity and finders keep working. Read the cborm 6 upgrading guide if you used Hibernate criteria internals.
  • From CFML: your persistent CFCs and ORM functions carry over. The migration guide lists the settings that were renamed or changed.

πŸ’š Thank You

BxORM 2.0 stands on Hibernate and on years of ideas from the ColdBox and BoxLang community, from cborm and mementifier to everyone who filed an issue, tested a beta or sent a pull request. Thank you.

Now go build something. πŸš€

Add Your Comment

Recent Entries

November 2026 Roundup: What’s New Across Ortus Solutions & BoxLang

November 2026 Roundup: What’s New Across Ortus Solutions & BoxLang

From BoxLang 1.19 and BoxLang AI 3.7 to new migration tooling, QA insights, hands-on AI development with students, and community events around the world, this month continued to show how the different parts of our ecosystem connect.

We also officially launched Into the Box 2027 in Orlando and opened our Ortus Year-End Offers, giving teams new ways to start planning their development, modernization, and training goals for the year ahead.

Here’s everything you may have missed in November.

Victor Campos
Victor Campos
December 01, 2026
Is Your CFML Upgrade Overdue? See Where BoxLang and BxLens Can Help

Is Your CFML Upgrade Overdue? See Where BoxLang and BxLens Can Help

An overdue ColdFusion or Lucee upgrade gets easier to scope when you know which workflows could be affected. See how BoxLang helps you assess a migration and how BxLens helps you investigate slow requests and recurring errors.

Maria Jose Herrera
Maria Jose Herrera
November 30, 2026
Announcing bxSites 1.0: Every Site You Run, From One Folder of Markdown

Announcing bxSites 1.0: Every Site You Run, From One Folder of Markdown

Ortus Solutions today announced bxSites 1.0, the first stable release of its free and open source site generator. bxSites turns plain Markdown into documentation, marketing sites, blogs, courses and knowledge bases that load fast, get found, read well for AI, deploy to any host and belong entirely to you.

Luis Majano
Luis Majano
November 30, 2026