Adobe COLDFUSION 9 Manual page 655

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
[ManyToMany(targetEntity="onetoone::Customer",fetchType="EAGER")]
[JoinTable(name="CUSTOMER_PARENTS_MAPPINGS")]
[JoinColumn(name="CUST_ID",referencedColumnName="cid")]
[InverseJoinColumn(name="PARENT_ID",referencedColumnName="cid")]
public var parents:Array;
// Many-to-Many self Join
[ManyToMany(targetEntity="onetoone::Customer",fetchType="EAGER")]
[JoinTable(name="CUSTOMER_CHILDREN_MAPPINGS")]
[JoinColumn(name="CUST_ID",referencedColumnName="cid")]
[InverseJoinColumn(name="CHILD_ID",referencedColumnName="cid")]
public var children:Array;
[OneToMany(targetEntity="onetoone::Order",cascadeType='REMOVE',mappedBy="customer",fetchType
="EAGER")]
public var orders:Array;
}
}
ArrayCollection to hold multiple entities
In addition to Array, you can now use ArrayCollection to hold multiple entities in a database relationship.
ArrayCollection can also be used in the ActionScript entities as Arrays are used to represent the related entities.
Example
package
{
import mx.collections.ArrayCollection;
[Bindable]
[RemoteClass(alias="AIRIntegration.customer")]
[Entity]
public class Customer
{
[Id]
[GeneratedValue(strategy="INCREMENT",initialValue=5,incrementBy=2)]
public var cid:int;
public var name:String;
[OneToOne(cascadeType='ALL',fetchType="EAGER")]
[JoinColumn(name="add_id",referencedColumnName="aid")]
public var address:Address;
[OneToMany(targetEntity="onetoone::Order",cascadeType='REMOVE',mappedBy="customer",fetchType
="EAGER")]
public var orders:ArrayCollection;
}
}
Server-side configuration
See the section
"Changes in the XML configuration files for Flash Remoting in ColdFusion 9 and ColdFusion
on page 674.
Last updated 8/5/2010
650
9.0.1"

Advertisement

Table of Contents
loading

Table of Contents