Installation
Leverage CommandBox to install into your ColdBox app:
1
# Latest version
2
install cborm
3
4
# Bleeding Edge
Copied!

System Requirements

  • Lucee 5.x+
  • ColdFusion 2016+

Application.cfc Setup

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:
Application.cfc
1
# In the pseudo constructor
2
this.mappings[ "/cborm" ] = COLDBOX_APP_ROOT_PATH & "modules/cborm";
Copied!

WireBox DSL

The module registers a new WireBox DSL called entityservice which can produce virtual or base orm entity services. Below are the injections you can use:
  • entityservice - Inject a global ORM service
  • entityservice:{entityName} - Inject a Virtual entity service according to entityName

Module Settings

Here are the module settings you can place in your ColdBox.cfc under moduleSettings -> cborm structure:
config/ColdBox.cfc
1
moduleSettings = {
2
cborm = {
3
// Resource Settings
4
resources : {
5
// Enable the ORM Resource Event Loader
6
eventLoader : false,
7
// Pagination max rows
8
maxRows : 25,
9
// Pagination max row limit: 0 = no limit
10
maxRowsLimit : 500
11
},
12
// WireBox Injection bridge
13
injection = {
14
// enable entity injection via WireBox
15
enabled = true,
16
// Which entities to include in DI ONLY, if empty include all entities
17
include = "",
18
// Which entities to exclude from DI, if empty, none are excluded
19
exclude = ""
20
}
21
}
22
}
Copied!

Validation

We have also integrated a UniqueValidator from the validation module into our ORM module. It is mapped into WireBox as [email protected] so you can use in your model constraints like so:
1
{ fieldName : { validator: "[email protected]" } }
Copied!

Supported Hibernate Versions

Lucee 5

Adobe 2016

Adobe 2018, Adobe 2021

Last modified 3mo ago