Whatever message this page gives is out now! Go check it out!
person.setAddress(address); |
address.setPerson(person); |
| Attribute | Applies to | Re/Opt | Default | Description |
| batchsize | one-to-manymany-to-many | Optional | An integer value that specifies the " batchsize " for fetching uninitialized collections. For details, see Batch fetching in Lazy Loading. | |
| cacheuse | one-to-many many-to-many | Optional | Use this value to specify the caching strategy to be used for caching this component's data in the secondary cache.See Caching for details. | |
| cachename | one-to-many many-to-many | Optional | <entityname> <relationname> | Use this value to specify the name of the secondary cache.See Caching for details. |
| cascade | all | Optional | See the Cascade options section for details. | |
| cfc | all | Required | Name of the associated CFC. | |
| constrained | one-to-one | Optional | false | Whether a constraint is set on this table's Primary Key column to reference the Primary Key in the other table: truefalseSee One-to-one relationships below for details. |
| fetch | all | Optional | select | Specifies whether join query or sequential select query will be used to retrieve the associated objects. The values are: join selectSee Lazy Loading for details. |
| fieldtype | all | Required | column | Specifies the type of relationship mapping:one-to- oneone -to- manymany -to- onemany -to-many |
| fkcolumn | all | Optional | Specifies the foreign key column.In case the relation is established using link table, this specifies the foreign key column in the link table that references the primary key of the source object.If the relationship is established using multiple foreign key columns (that reference the composite key of the source table), then you must use comma-separated column names.Also, the order in which the column names are specified must match the order of composite keys defined. If you do not specify any values, then
| |
| foreignkeyname | one-to-one many-to-one, many-to-many | Optional | autogenerated | Specifies the name of the foreign key constraint. This is used only when the tables are created by ORM. |
| index | many-to-one | Optional | false | Specifies the name of the index for the foreign key column. |
| insert | many-to-one | Optional | true | Specifies whether the column should be included in SQL UPDATE and/or INSERT statements. Values are:true false}}Set {{update=false and insert=false if the column needs to be read-only. |
| inverse | one-to- manymany -to-many | Optional | false | Specifies whether SQL query should be executed for this association when persisting this object. Value are : truefalse See "Inverse" section for details. |
| inversejoincolumn | all | Optional | Specifies the foreign key column in the Join table that references the primary key column in the target table. In case of a composite key, you can use a comma-separated list of column names. If the join table has multiple foreign key columns (that reference the composite key of the target table), then you must use comma-separated column names.Also, the order in which the column names are specified must match the order of composite keys defined.If you do not specify any values, then
| |
| lazy | all | Optional | true | Specifies if the association should be loaded lazily. truefalseextraSee Lazy Loading for details. |
| linkcatalog | all | Optional | Catalog for the link table. | |
| linkschema | all | Optional | Schema for the link table. | |
linktable | all | Required | Name of the link table. | |
| mappedby | all | Optional | In a relationship, the foreign key can reference a unique column other than the primary key. In such cases, use mappedby to specify the property name that maps to the unique key column. Note that the value of this property is case-sensitive. | |
| missingrowIgnored | many-to-one, many-to-many, (in ColdFusion 9.0.1) one-to-one | Optional | false | Values are: truefalseIf the value is true, and the row that is referenced by the foreign key is missing, it is treated as a null association.The default is false, in which case an exception is thrown. |
| name | all | Required | Name of the field | |
| notnull | many-to-one | optional | false | Use this to add the not-null constraint for the foreign key column when the table is created by ORM. |
| optimisticlock | all | optional | true | Whether updates to this property need acquisition of the optimistic lock on the table row. Values are: truefalseSee Optimistic locking for details. |
| orderby | one-to- manymany -to-many | optional | Specifies the orderby string that needs to be used to sort the associated collection. Use the following format to specify this string: "col1 <asc/desc> (, col2<asc/desc>)" or "col1(, col2)" In the latter case, asc is taken as default. | |
| readonly | one-to-manymany-to-many | optional | false | Values are: true|false If set to true, it indicates that the collection never changes and can be cached. |
| remotingFetch | all | optional | false | The value of the remotingFetch attribute is false by default for any property that shares one-to-one, one-to-many, many-to-one, or many-to-many relationship. Set this value to true to retrieve data on the client-side. |
| singularname | one-to- manymany -to-many | optional | property name | Use this property to define the custom name for generated relationship methods. See Generated methods for relationships between CFCs. |
| structkeycolumn | one-to- manymany -to-manytype=struct | optional | The column in the target table to use as key if the collection type is struct . | |
| structkeytype | one-to- manymany -to-many type =struct | optional | Specifies the data type of the key, when type=struct. For the entire list of data types, see the Data Types section. | |
| type | one-to- manymany -to-many | optional | Specifies the datatype of the relationship property:array struct | |
| update | many-to-one | optional | true | Specifies whether the column should be included in SQL update statement:truefalseSet update=false and insert=false if the column needs to be read-only. |
unique | many-to-one | optional | false | Use this to add the unique constraint for the foreign key column when the table is created by ORM. This effectively makes this relation one-to-one. |
| uniquekey | many-to-one | optional | Groups columns in a single unique key constraint. | |
| where | one-to- manymany -to-many | optional | Use this to specify a SQL that will be used to filter the collection retrieved. See "Applying filters on relationship" for details. |
<cfproperty name="unsoldArts" cfc="Art" fieldtype="one-to-many" fkcolumn="ARTISTID" where="issold=0"><cfproperty name="fieldname"
fieldtype="one-to-one"
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"
cascade="cascade_options"
constrained="true|[false]"
fetch="join|[select]"
lazy="[true]|false"><cfcomponent persistent="true" table="Employee">
<cfproperty name="id" fieldtype="id" generator="native">
<cfproperty name="firstname">
<cfproperty name="lastname">
<cfproperty name="officecubicle" fieldtype="one-to-one" cfc="OfficeCubicle">
</cfcomponent><cfcomponent persistent="true" table="OfficeCubicle">
<cfproperty name="id" fieldtype="id" generator="foreign" params="{property='Employee'}" ormtype="int">
<cfproperty name="Employee" fieldtype="one-to-one" cfc="Employee" constrained="true">
<cfproperty name="Location">
<cfproperty name="Size">
</cfcomponent><cfproperty
name="fieldname"
fieldtype="one-to-one"
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"
mappedby="Mapped_Field_name_in_referenced_CFC"
cascade="none"
fetch="join|[select]"
lazy="[true]|false"><cfcomponent persistent="true" table="Employee">
<cfproperty name="EmployeeID" fieldtype="id" generator="native">
<cfproperty name="firstname">
<cfproperty name="lastname">
<cfproperty name="officecubicle" fieldtype="one-to-one" cfc="officecubicle" mappedby="Employee">
</cfcomponent><cfcomponent persistent="true" table="officecubicle">
<cfproperty name="id" fieldtype="id" generator="native">
<cfproperty name="Employee" fieldtype="one-to-one" cfc="Employee" fkcolumn="EmployeeID">
<cfproperty name="Location">
<cfproperty name="Size">
</cfcomponent><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="array"
orderby="order_by_string"
cascade="cascade_options"
lazy="[true]|false|extra"
fetch="join|[select]"
inverse="true|[false]"
batchsize="N"
optimisticlock="[true]|false"
readonly="true|[false]"><cfproperty name="art" type="array" fieldtype="one-to-many" cfc="Art" fkcolumn="ARTISTID"><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]"><cfproperty name="art" type="struct" fieldtype="one-to-many" cfc="Art" fkcolumn="ARTISTID" structkeytype="int" structkeycolumn="ArtID"><cfproperty
name="fieldname"
fieldtype="many-to-one"
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"
column="Foreign_Key_Column"
mappedby="Mapped_Field_name_in_referenced_CFC"
cascade="cascade_options"
fetch="join|[select]"
lazy="true|false"
insert="[true]|false"
update="[true]|false"
optimisticlock="[true]|false"
missingrowIgnored="true|[false]"><cfproperty name="artist" fieldtype="many-to-one" fkcolumn="artistid" cfc="Artist"><cfproperty
name="fieldname"
fieldtype="many-to-many"
cfc="fully qualified 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 a composite key with comma-separated primary key columns"
mappedby="Property in the target component that is referenced by fkcolumn in join table"
type="[array]|struct"
orderby="order by String
structkeycolumn="The structure key column name"
structkeydatatype="datatype".
cascade="cascade options" inverse="true|[false]" lazy = "[true]|false" [optional] fetch="join|[select]" [optional] batchsize="integer" optimisticlock="[true]|false" readonly="true|[false]"
missingrowIgnored="true|[false]"><cfproperty
name="products"
fieldtype="many-to-many"
CFC="Product"
linktable="Order_Product"
FKColumn="orderId"
inversejoincolumn="productId"
lazy="true"
cascade="all"
orderby="productId"><cfproperty
name="orders"
fieldtype="many-to-many"
CFC="Order"
linktable="Order_Product"
FKColumn="productId"
inversejoincolumn="orderId"
lazy="true"
cascade="all"
orderby="orderId">