cborm
Install
v3.x
v3.x
  • Introduction
  • Intro
    • Release History
      • What's New With 3.9.0
      • What's New With 3.8.0
      • What's New With 3.7.0
      • What's New With 3.6.0
      • What's New With 3.5.0
      • What's New With 3.4.0
      • What's New With 3.3.0
      • What's New With 3.2.x
      • What's New With 3.1.0
      • What's New With 3.0.0
    • About This Book
    • Author
  • Getting Started
    • Overview
    • Installation
    • Basic Crud - Services
    • Basic Crud - ActiveEntity
  • Base ORM Service
    • Overview
    • Service Properties
    • Concrete Services
    • Service Methods
      • Criteria Queries
        • getRestrictions
        • newCriteria
      • Creation - Population
        • new
        • populate
        • populateFromJSON
        • populateFromQuery
        • populateFromXML
      • Counters
        • count
        • countWhere
        • exists
      • Deleting Entities
        • delete
        • deleteAll
        • deleteByID
        • deleteByQuery
        • deleteWhere
      • Entity Convenience Methods
        • getDirtyPropertyNames
        • getEntityGivenName
        • getEntityMetadata
        • getKey
        • getKeyValue
        • getPropertyNames
        • getTableName
        • isDirty
        • refresh
      • Finders
        • findit
        • findOrFail
        • findByExample
        • findWhere
        • findAll
        • findAllWhere
      • Getters
        • get
        • getOrFail
        • getAll
      • ORM Session
        • clear
        • evict
        • evictCollection
        • evictQueries
        • getSessionStatistics
        • isSessionDirty
        • merge
        • sessionContains
      • Querying
        • executeQuery
        • list
      • Saving Entities
        • save
        • saveAll
      • Utility Methods
        • autoCast
        • createService
        • idCast
        • nullValue
        • when
    • Dynamic Finders- Counters
      • Method Signatures
      • Method Expressions
      • Query Options
    • Automatic Java Types
  • Virtual Services
    • Overview
    • Service Properties
    • Concrete Virtual Services
  • Active Record
    • Active Entity Overview
    • Constructor Properties
    • Usage
    • Validation
  • Criteria Queries
    • Criteria Builder
      • Getting Started
      • Restrictions
        • Value Casting
        • SQL Restrictions
      • Modifiers
      • Results
      • Associations
      • Projections & Aggregates
    • Detached Criteria Builder
      • Getting Started
      • Projections
      • Subqueries
      • DetachedSQLProjection()
      • Criterias
      • Associations
    • Help! I'm Not Getting the Result I expected!
  • Advanced Features
    • Automatic REST Crud
    • Hibernate Logging
    • Mementifier
    • ORM Events
      • Custom Event Handler
    • Unique Property Validation
Powered by GitBook
On this page
  • System Requirements
  • Application.cfc Setup
  • WireBox DSL
  • Module Settings
  • Validation
  • Supported Hibernate Versions
  • Lucee 5
  • Adobe 2016
  • Adobe 2018, Adobe 2021

Was this helpful?

Edit on Git
Export as PDF
  1. Getting Started

Installation

Leverage CommandBox to install into your ColdBox app:

# Latest version
install cborm

# Bleeding Edge
install cborm@be

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
# In the pseudo constructor
this.mappings[ "/cborm" ] = COLDBOX_APP_ROOT_PATH & "modules/cborm";

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
moduleSettings = {
    cborm = {
        // Resource Settings
    		resources : {
    			// Enable the ORM Resource Event Loader
    			eventLoader 	: false,
    			// Pagination max rows
    			maxRows 		: 25,
    			// Pagination max row limit: 0 = no limit
    			maxRowsLimit 	: 500
    		},
        // WireBox Injection bridge
        injection = {
            // enable entity injection via WireBox
            enabled = true, 
            // Which entities to include in DI ONLY, if empty include all entities
            include = "", 
            // Which entities to exclude from DI, if empty, none are excluded
            exclude = ""
        }
    }
}

Validation

We have also integrated a UniqueValidator from the validation module into our ORM module. It is mapped into WireBox as UniqueValidator@cborm so you can use in your model constraints like so:

{ fieldName : { validator: "UniqueValidator@cborm" } }

Supported Hibernate Versions

Lucee 5

Adobe 2016

Adobe 2018, Adobe 2021

PreviousOverviewNextBasic Crud - Services

Last updated 3 years ago

Was this helpful?

Hibernate 3.5 -

Hibernate 5.4 -

You will need to update to the latest ORM Beta Extension -

Hibernate 4.3 -

Hibernate 5.2 -

https://docs.jboss.org/hibernate/core/3.5/reference/en-US/html/querycriteria.html
https://hibernate.org/orm/documentation/5.4/
https://download.lucee.org/#FAD1E8CB-4F45-4184-86359145767C29DE
5.4.29.6-BETA (Aug 6, 2021)
https://hibernate.org/orm/documentation/4.3/
https://hibernate.org/orm/documentation/5.2/