Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 553

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion ORM
Attribute
Req/Opt
selectkey
optional
optional
sqltype
optional
unSavedValue
Composite Key
If the primary key consists of more than one column, it is called as a composite key. A composite key can be specified
by using
' on all the properties that form the primary key.
fieldtype='id
Example
If in a table, the columns Order_id and Product_id form a composite key, then, they should be defined as:
<cfproperty name="Order_Id" fieldtype="id" column="Order_Id">
<cfproperty name="Product_Id" fieldtype="id" column="Product_Id">
For a composite key, the generator should always be "
Generators
Generators are algorithms that are used to generate unique identifiers for instances of the persistent CFC. Generators
can have any one of the following values:
: This algorithm generates identifiers of type
increment
by ORM. This is commonly used when auto-generation for the primary key is not enabled in the table and you want
ORM to generate the primary key. This should be used when a single instance of ColdFusion is the only process to
insert data into the table.
: For databases such as DB2, MySQL, Sybase, and MS SQL, which support identity columns, you can use
identity
identity key generation. The key is automatically generated by the database and the object is populated with the
generated key. This strategy requires ORM to execute two SQL queries to insert a new object.
: For databases such as DB2, Oracle, PostgreSQL, Interbase, McKoi, and SAP, which support sequences,
sequence
you can use sequence style key generation. The key is automatically generated by the database and the object is
populated with the generated key. This strategy requires ORM to execute two SQL queries to insert a new object.
This generator includes the sequence parameter, which needs to be specified in the
For example:
<cfproperty name="id" fieldtype="id" generator="sequence"
params="{sequence='id_sequence'}">
: This algorithm is commonly used to automatically generate primary keys. This generator picks identity or
native
sequence depending upon the capabilities of the underlying database.
: This algorithm is used when the application needs to assign its own identifier to the object. It is the
assigned
default generator used by ColdFusion.
Default
Description
The column name that is used to retrieve the primary key
generated by a database trigger.
Use this attribute to specify the DB-specific SQLType that
should be used for the column. This attribute is used for
table creation only.
If this attribute is not specified, ColdFusion will
automatically decide the SQLType based on the
ormtype
An identifier property value that indicates that an
instance is newly instantiated and not saved/loaded in
the database
".
assigned
,
, or
long
short
Last updated 1/20/2012
specified for this property.
by incrementing a counter maintained
int
attribute.
params
548

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents