Client Side - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
private var name:String; // Private property
[Column(name="FNAME",columnDefinition="VARCHAR")]
public function set fname(name:String):void // accessor function
{
this.name = name;
}
public function get fname():String // accessor function
{
return name;
}

Client Side

ColdFusion 9 extends offline application support to the client side of the application by letting you code ActionScript
elements on the client side. The data that is exchanged and synchronized on the client side is managed through
persistent objects in the local or offline database.
Managing relationships
The ActionScript persistent framework lets you define the following relationship types between two persistent objects.
• one-to-one
• one-to-many
• many-to-one
• many-to-many
To understand how the persistent framework handles relationships, let us consider an example of the Employee and
Department objects in a database.
If you do not specify attribute values, the default values are taken as follows:
• The default table name is the class name.
• The default value for
columnDefinition
• The default value for
referencedColumnName
• The default value for
targetEntity
Note: In case you are using ORM CFCs, the remotingFetch attribute in the <cfproperty> tag is set to false by default for
all relationships. You must set this attribute to true to retrieve data on the client side.
One-to-one relationship
Consider a one-to-one relationship where one employee belongs to a single department. You can use code like the
following to define a one-to-one mapping between the Department and Employee objects with DEPTID as the foreign
key column name.
[Entity]
[Table(name="employee")]
public class Employee
{
[Id]
var id:uint;
[OneToOne(targetEntity="Department"|fetchType="EAGER(default)|LAZY")]
[JoinColumn(name="DEPTID", referencedColumnName="DEPT_ID")]
var dept:Department;
}
is the ActionScript type of the field.
is the primary key of the target entity.
is the ActionScript type of the referring field.
Last updated 1/20/2012
629

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents