FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

ColdBox ORM Extensions

v1.5.0+84 Public

Build Status

Welcome To The ColdBox ORM Module

This module provides you with several enhancements when interacting with the ColdFusion ORM via Hibernate. It provides you with virtual service layers, active record patterns, criteria and detached criteria queries, entity compositions, populations and so much more to make your ORM life easier! In other words, it makes using ORM not SUCK! 🚀


Apache License, Version 2.0.


Source & Changelog

  • Changelog




  • Lucee 5+
    • Hibernate 3.5.x
  • ColdFusion 2016
    • Hibernate 4.3.10
  • ColdFusion 2018
    • Hibernate 5.2.11


Use CommandBox cli to install:

box install cborm

Unfortunately, due to the way that ORM is loaded by ColdFusion, if you are using the ORM EventHandler or ActiveEntity or any ColdBox Proxies that require ORM, you must create an Application Mapping in the Application.cfc like this:

this.mappings[ "/cborm" ] = COLDBOX_APP_ROOT_PATH & "modules/cborm";

This is due to the fact that the ORM event listener starts before ColdBox, so no dynamic mappings exist yet. Important: Make sure you ALWAYS lazy load dependencies in your event handlers to avoid chicken and the egg issues.

WireBox DSL

The module also registers a new WireBox DSL called entityservice which can produce virtual or base ORM entity services:

  • entityservice - Inject a global ORM service so you can work with ANY entity
  • entityservice:{entityName} - Inject a Virtual entity service according to entityName


Here are the module settings you can place in your ColdBox.cfc under an orm structure:

orm = {
    injection = {
        enabled = true, include = "", exclude = ""


We have also migrated the UniqueValidator from the validation module into our ORM module. It is mapped into wirebox as [email protected] so you can use in your constraints like so:

{ fieldName : { validator: "[email protected]" } }

Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp


Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.

"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. And not only so, but we glory in tribulations also: knowing that tribulation worketh patience; And patience, experience; and experience, hope: And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5


"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12



Compatibility Updates

  • You will need to move the orm configuration structure in your config/ColdBox.cfc to the moduleSettings struct and rename it to cborm to standardize it to module settings.
moduleSettings = {

	cborm = {
		inject = {
			enabled = true, 
			includes = "",
			excludes = ""

  • deleteByQuery() reworked entirely to do native bulk delete queries. It now also returns the number of records removed

General Updates

  • Mementifier is now a dependency for cborm. (, which can be used for producing state out of ORM entities for auditing or building JSON Api's.
  • Performance update on creating active entities as datasource discovery has been reworked
  • Updated build process to latest in Ortus template
  • Dropped Railo, Lucee 4.5, ACF11 support
  • More direct scoping for performance updates
  • Optimized EventHandler so it is lighter and quicker when doing orm injections
  • Documented all functions with extra examples and notes and hibernate references
  • ColdBox 5 and 4 discrete ORM Injection DSLs

Base ORM Service

  • Update getEntityGivenName to support ACF2018
  • Lazy loading BeanPopulator for performance on creations
  • Lazy loading ORMEventHandler for performance on creations
  • Lazy loading restrictions for performance on creations
  • Base service can now be initialized with a datasource, or uses the default one declared
  • Removed byExample on many listing methods
  • Added optional datasource to many listing methods
  • Added consistency on querying options to all major functions to include ignoreCase, sorting and timeouts.
  • Added ability to getAll() to retrieve read only entities using the readOnly argument.
  • The getAll() method has a new properties argument that if passed will allow you to retrieve an array of structs according to the passed in properties.
  • New method: idCast( entity, id ) to auto cast your entity id value to java type automatically for you, no more javacasting
  • New method: autoCast( entity, propertyName, value ) to auto cast any value for any entity property automatically, no more javacasting.
  • New method: getKeyValue( entity ) which will give you the value of the entity's unique identifier
  • New method: isDirty( entity ) which will let you know if the entity has dirty values or has its values changed since loaded from the db
  • New method: getEntityMetadata( entity ) which will return to you the hibernate's metadata for a specific entity.
  • getPropertyNames() argument of entityname renamed to entity to allow not only for a name but an actual entity as well.
  • getTableName() argument of entityname renamed to entity to allow not only for a name but an actual entity as well.
  • getKey() argument of entityname renamed to entity to allow not only for a name but an actual entity as well.
  • ORM Encapsulation of hibernate metadata retrieval via getEntityMetadata()
  • deleteByQuery() reworked entirely to do native bulk delete queries. It now also returns the number of records removed
  • deleteWhere() missing flush argument, added datasource as well

Virtual Entity Service

Remember this entity extends Base Service, so we get all the features above plus the following:

Active Entity

Remember this entity extends the Virtual Service, so we get all the features above plus the following:

  • Faster creation speeds due to lazy loading of dependencies and better datasource determination.


  • Performance improvements for criteria building as we now build up the dialect and support structs
  • ACF 2018 Support via Hibernate 5
  • Update to leverage new module template schema
  • Updated readme from old text


  • ColdBox 5 Support
  • Dependency updates
  • Some syntax updates
  • Fix getKey() return typing to allow composite keys:
  • Update to module standard template
  • Updated dependencies


  • Pass the target value as the rejected value for Unique validator
  • Travis Updates
  • Dependency updates
  • Lucee 5 exceptions on ORM Util due to abstract keyword


  • Travis updates
  • COLDBOX-460 Dynamic finders fixed by always adding datasource attribute to hql query
  • Fixes an interface error on AC11 startup


  • Fixed box.json version number


  • BaseORMService.merge doesn't seem to merge entities back into session #10
  • Variable scoping in SQLHelper.cfc bug #9
  • Update build process to leverage Travis
  • Updated cbvalidation to v1.1.0
  • Build cleanup
  • Replaced StringBuffer with StringBuilder for performance


  • Updated cbvalidation dependency
  • Prevent conditionals from being stripped from property names
  • Updated build for api docs and commandbox usage for dependencies
  • ORM Unique validation not working


  • updates to all dependencies
  • production ignore lists


  • CF11Compat - arrayContainsNoCase() Is not a function
  • Lucee support


  • Create first module version

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
2.0.0-snapshot Feb 14 2019 05:09 PM Jun 21 2019 05:59 PM
Version History
1.6.0-snapshot Sep 10 2018 03:13 PM Jan 30 2019 06:24 PM
1.5.0+84 Sep 10 2018 03:18 PM Sep 10 2018 03:18 PM
1.5.0-snapshot Mar 15 2018 06:36 PM Sep 07 2018 05:31 PM
1.4.0+79 Mar 15 2018 06:35 PM Mar 15 2018 06:35 PM
1.4.0-snapshot Jul 18 2017 08:16 PM Mar 15 2018 04:50 PM
1.3.0+47 Dec 06 2016 07:40 PM Dec 06 2016 07:40 PM
1.2.2+35 Oct 09 2016 11:42 AM Oct 09 2016 11:42 AM
1.2.1 May 09 2014 09:23 PM Jun 10 2016 10:39 AM


No collaborators yet.
  • May 09 2014 09:23 PM
  • Jun 21 2019 05:59 PM
  • 3928
  • 2083
  • 30669