Adobe COLDFUSION 9 Manual page 568

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion ORM
<cfproperty
name="field_name"
fieldtype="one-to-many"
cfc="Referenced_CFC_name"
linktable="Link table name"
linkcatalog="Catalog for the link table"
linkschema="Schema for the link table"
fkcolumn="Foreign Key column name"
inversejoincolumn="Column name or comma-separated list of primary key columns"
type="struct"
orderby="order_by_String"
structkeycolumn = "Structure_Key_Column"
structkeytype="ormtype"
cascade="cascade_options"
lazy="[true]|false|extra"
fetch="join|[select]"
inverse="true|[false]"
batchsize="N"
optimisticlock="[true]|false"
readonly="true|[false]">
For the artist-art example, you can define the relationship property as:
<cfproperty name="art" type="struct" fieldtype="one-to-many" cfc="Art" fkcolumn="ARTISTID"
structkeytype="int" structkeycolumn="ArtID">
specifies that the artist object will contain art objects in a struct.
type=struct
structkeycolumn="ArtID"
Note that ARTID is the primary key in Art table.
specifies the datatype of
structkeytype="int"
specifies that the foreign key column is ARTISTID that references the primary key of Artist
fkcolumn="ArtistID"
table.
Many-to-one relationship
A many-to-one relationship is the inverse of a one-to-many relationship. In this relationship, many source objects can
reference the same target object.
An example of this relationship is the relation between Art and Artist, where many Art are created by the same Artist.
This relationship is established with the foreign key in the source table that references the primary key in the target
table.
A many-to-one relationship between two persistent components is defined using the
in the
tag.
cfproperty
specifies that the key of the struct would be ArtID.
structkeycolumn
Last updated 8/5/2010
.
value
fieldtype
563
many-to-one

Advertisement

Table of Contents
loading

Table of Contents