Adobe COLDFUSION 9 Manual page 643

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
• When the client does an update but that record no longer exists on the server. Again, a conflict can be passed to the
client from the server by creating an instance of Conflict.cfc and returning it. There is no need to set a serverobject
property, as there is no server instance of the inserted data.
• When the client did an insert, but for example, the server data uses an autoincrement primary key field. The server,
therefore, does not use the primary key inserted by the client. To inform the client of the correct key field value, the
server returns the conflict cfc instance with the server instance. The ActionScript Calling keepServerObject method
can then update the local data with the new primary key value from the server.
Note: After a commit or conflict resolution, it is recommended to synchronize the client database with the server data
source, because the server can have new data available from other clients.
ActionScript has a few reserved keywords. When you name the Class/SQLite table, ensure that you do not use any of
the reserved keywords. For example,
the table creation fails. To avoid this name conflict, use the
the default name. Your code for the Order.as class could look something like the following:
package test
{
[Entity]
[Table(name="OrderTable")]
public class Order
{
public function Order()
{
}
[Id]
public var oid:uint;
public var name:String;
[ManyToMany(targetEntity="test::Product",cascadeType='ALL')]
public var products:Array;
}
}
Offline AIR application example
The example here describes how to build an offline AIR application that has a one-to-one relationship between the
Customer and Address objects in the database. You can use this example as a basis to build offline AIR applications
for the other relationship types.
Client-side (AIR application) code
Create a folder called "onetoone" in your AIR project and add the ActionScript class files: Customer.as and Address.as
with code that could be something like the following:
is an ActionScript reserved keyword. If you name a table or class as
Order
[Table(name="OrderTable")]
Last updated 8/5/2010
638
,
Order
metadata tag to override

Advertisement

Table of Contents
loading

Table of Contents