ORM:introduction

last edited byusericongef on 28-Oct-2010

Contents

ORM with Railo

This section is going to describe how ORM (object relational mapping) is handled by Railo 3.2 Server. Railo Server uses Hibernate in the background for implementing ORM. If you want to learn more about Hibernate, just check the corresponding documentation.

What is ORM

According to Wikipedia ORM is: Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ORM tools.. You can find the complete description of ORM on Wikipedia.

Basically ORM is a way to store your objects in a database automagically. In Railo these objects of course are CFC components. So what we are trying to do is to save the data that is stored inside a CFC into a flat database table. This of course is not the only advantage one gets when using ORM. In my opinion the greatest benefit is the standartization of the storage mechanism across databases. Instead of writing lots of <CFQUERY> tags you will only have to call some procedures. So here the pros of ORM:

Pros

Of course using ORM has some disadvantages as well. So lets have a look at the cons of ORM:

Cons

So ORM is something you should consider as soon as you have to plan or design a new CFML project. This documentation will show you how ORM works with Railo 3.2 and what you need to do in order to configure it. We will cover the different configuration options and the implications on the result.

In order to store CFC's in the database Railo will introduce new object types called entities in the further context. Therefore the functions that handle these entities are called Entity*(). Like EntityLoad() or EntitySave() etc. In the future when we talk of CFCs that need to be saved to the database, we speak of persistent CFCs.

 
Download in other Formats:
markup Markup | pdf PDF | html HTML | word Word

comments Comments (0)

You need to login in order to comment!