Ortus ORM Extension logo

Ortus ORM Extension

Empower your CFML app with Hibernate ORM!

Overview

The Ortus ORM extension is a Lucee Server extension which adds native Hibernate ORM support to your Lucee CFML application. With Hibernate, you can interact with your database records in an object oriented fashion, using components to denote each record and simple getters and setters for each field value:

                    component entityName="Auto" persistent="true" {

                        property name="id" type="string" fieldtype="id" ormtype="string";
                        property name="make" type="string";
                        property name="model" type="string";
                    
                        function onPreInsert(){
                            log.info( "Inserting new Auto: #getMake()# #getModel()#" );
                        }
                    }
                

The Ortus ORM extension also enables transactional persistence, where an error during a save will roll back the entire transaction to prevent leaving the database in a broken state:

                    transaction{
                        try{
                            entitySave(
                                entityNew( "Purchase", {
                                    productID : "123-expensive-watch",
                                    purchaseTime : now(),
                                    customerID : customer.getId()
                                })
                            );
                            var cartProducts = entityLoad( "CartProduct", customer.getID() );
                            entityDelete( cartProducts );
                        } catch ( any e ){
                            // don't clear the user's cart if the purchase failed
                            transactionRollback();
                            rethrow;
                        }
                    }
                

Capabilities

  • Add Object Relational Mapping to any CFML app with Hibernate ORM
  • Use native CFML methods to update and persist entities to the database (entityNew(), entitySave(), ormFlush(), etc.)
  • Supports 80+ database dialects, from SQLServer2005 to MySQL8 and PostgreSQL
  • 60% faster startup than the Lucee Hibernate extension
  • Generate your mapping XML once and never again with the autoGenMap=false ORM configuration setting
  • React to entity changes with pre and post event listeners such as onPreInsert(), onPreUpdate() and onPreDelete()

See the extension changelog for a full list of enhancements and bug fixes.

Installation

From the Lucee Server Admin

You can manually install the Ortus ORM extension by opening the Lucee server admin page and browsing to Extension > Applications page, where you'll see a "Ortus ORM Extension" option. Clicking this option will open the installation screen, where you can choose any extension version and click "Install" to install from Forgebox. You can also download a .lex file from our downloads page and upload this through the main Applications page.

From CommandBox

You can install this extension into a preconfigured Lucee server via Commandbox:

                        box install D062D72F-F8A2-46F0-8CBC91325B2F067B
                    

This will not work unless box server start has been run first to set up the Lucee engine directories. Use --dryRun to set up the Lucee server without actually starting the server process. This will prevent ORM from attempting to initialize before the extension is installed:

                        box
                        box> server start --dryRun
                        box> install D062D72F-F8A2-46F0-8CBC91325B2F067B
                        box> server start
                    

Professional Support

We have been working with Hibernate ORM and Lucee Server for a number of years now and we love fine-tuning your queries and configuration to get the best possible performance from your ORM layer. We have built several solutions on top of Hibernate as well to help with criteria queries, secondary caches, transaction management, and more. If you need performance optimization, session management or caching integrations, then we are here to help.

FAQ

waveup-lightBlue
waveup-lightBlue
Got Questions?

Got Questions?

Please contact us at consulting@ortussolutions.com for further information or click the button below and send us a quick message.

CONTACT US