Mura ORM

Introduction

Most software applications have to interact with relational databases, such as MySQL, Microsoft SQL Server, and Oracle, to name a few. Many developers have struggled with the complexities of mapping their relational databases to objects. Mura CMS has a custom Object Relational Mapping (ORM) framework to enable developers the ability to define mappings between their object model and the relational database.

Using Mura ORM allows you to access and modify objects quickly and easily, without having to write tons of custom DAOs, relying on class extensions, and maintaining several database-vendor-specific CRUD statements, and more.

If you're familiar with ColdFusion-based Hibernate ORM, then you will be able to jump in rather quickly. If not, then you may want to brush up on at least the basics of CF-ORM. Sam Farmer wrote a nice "Intro to ORM" article with some hands on exercises on the LearnCFInAWeek.com site at www.learncfinaweek.com/week1/Intro_to_ORM/. In addition, Mark Mandel wrote a great article for Adobe at www.adobe.com/devnet/coldfusion/articles/coldfusion9_orm.html.  Finally, there's an excellent book by John Whish available at www.coldfusionormbook.com for those who would like to learn more.

Why Mura ORM?

The CFML-based ORM is great for defining entity properties, CRUD operations, and managing relationships with other ORM entities. However, it's not so good for creating relationships to Mura's core entities or working with DI/1. For example, relationships can't be based on DI/1 BeanName or Alias, because it must be the component path. Not to mention having to deal with sharing hibernate sessions with other applications and/or plugins. Plus, when things go wrong in CFML-based ORM, it's not always easy to troubleshoot.

Basics

Mura ORM entities are accessible via:

Mura ORM takes avantage of DI/1 dependency injection, and has familiar interactions:

Other familiar interactions with Mura's objects/beans:

Target via Mura Events:

They also:

  • Know how to bundle themselves
  • Play well with Mura content versioning
  • Have a very similar implmentation as CFML's ORM

Component (CFC) Attributes

Property Attributes

Validation Attributes

Support for CFML ORM Events