Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 582

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion ORM
• hasArt(Art art)
Perform create, read, update, delete operations on ORM Objects
In any data-centric application, you can perform the following operations on the database:
• Insert (Create)
• Update
• Retrieve
• Delete
Once the object relational model is defined in a ColdFusion application, you can perform CRUD operations on the
objects directly using the methods provided by ColdFusion ORM. ColdFusion ORM, in turn, takes care of persisting
the object in the database.
Create entities
EntityNew
Creates an object for persistent CFC with the given entity name. This is similar to CreateObject but it uses
whereas CreateObject takes CFC name. If there is no CFC defined in the application with the given
error will be thrown.
If the persistent CFC has an
object.
Syntax
<entity> EntityNew("<entityName>")
Save entities
EntitySave
Saves or Updates the data of the entity and all related entities to the database.
ColdFusion automatically tries to find if a new record should be inserted or an existing record be updated for the given
entity. If
forceinsert=true,
Calling this method may not run the insert/update SQL immediately. It is possible that various SQL statements are
queued and then run as a batch for performance reasons. The SQL statements are run when the ORM session is
flushed.
Syntax
EntitySave(entity, [forceinsert])
Parameter
Description
entity
The Entity that needs to be saved in the database.
If true, then ColdFusion always tries to insert the entity as a new record.
forceinsert
method, then the function
init
then ColdFusion always tries to insert the entity as a new record.
Last updated 1/20/2012
calls the
method while creating the
EntityNew
init
577
entityname
, an
entityname

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents