Skip to content

Instantly share code, notes, and snippets.

@samfarmer
samfarmer / gist:3795231
Created September 27, 2012 17:19
CF Null and structKeyExists
<cfscript>
noise = { siren="ambulance", volume=11 };
writeDump( noise );
noise.volume = javacast("null", "" );
writeDump( noise );
writeDump( structKeyExists( noise, "volume" ) );

Introduction

Object-Relational Mapping (ORM) allows you to work with objects and have them saved to the database automatically. It can greatly simplify create-read-update-delete (CRUD) operations and make your code more object-oriented. Under the hood ColdFusion uses the industry leading ORM framework called Hibernate.

Configuration

Application.cfc

Two settings are needed in the Application.cfc file to make an application use ORM: a datasource and ormEnabled set to true.