Whatever message this page gives is out now! Go check it out!
fieldtype="collection"
type="array"
table="table_name"
fkcolumn="foreign_key_column_name"
elementtype="ormtype"
elementColumn="column_name from the link table that should be
used for populating"
orderby="order by string"
lazy = "true|[false]"
readonly="true|[false]"
optimisticlock="[true]|false"
batchsize="batch size"><cfproperty name="artNames" fieldtype="collection" type="array" table="ART" fkcolumn="ARTISTID" elementcolumn="ARTNAME" elementtype="string">| Attribute | Req/Opt | Default | Description |
| batchsize | Optional | An integer value that specifies the "batchsize" for fetching uninitialized collections. For details, see Lazy Loading. | |
| elementColumn | Required | Specifies the column name that contains the data to be fetched for collection. | |
| elementtype | Optional | String | Data type of the selected column. See ORM data typesin Map the properties for details. |
| fieldtype | Required | Should be "collection". | |
| fkcolumn | Optional | The foreign key column in the specified table.If you do not specify the foreign key column and useDBForMapping is true in ormsettings, ColdFusion automatically determines a foreign key column after inspecting the database. | |
| lazy | Optional | true | Specifies if loading is to be done lazily:truefalseSee Lazy Loading for details. |
| name | Required | Name of the collection. | |
| optimisticlock | Optional | true | Specifies the locking strategy.truefalse |
| orderBy | Optional | Specifies the Order By string. | |
| readonly | Optional | false | truefalseIf set to true, it indicates that the collection never changes and can be cached. |
| table | Required | Name of the table from where the values will be fetched. | |
| type | Optional | array | Specifies if the collection type is:arraystruct |
name="field_name"
fieldtype="collection"
type="struct"
table="table_name"
fkcolumn="foreign_key_column_name"
structkeycolumn="column in the target table to be used as key in the struct"
structkeytype="ormtype of the key in the struct"
elementtype="ormtype of the valye in the struct"
elementColumn="column name from the table that should be used in
value of struct"
orderby="order by string"
lazy = "[true]|false"
readonly="true|[false]"
optimisticlock="[true]|false"
batchsize="batch size">| Attribute | Req/Opt | Default | Description |
| batchsize | Optional | An integer value that specifies the "batchsize" for lazily fetching instances of this collection. | |
| elementcolumn | Required | Specifies the column name that contains the data to be fetched for collection. | |
| elementtype | Required | Data type of the value. See ORM data types in Map the properties for details. | |
| fieldtype | Required | Should be a collection. | |
| fkcolumn | Optional | The foreign key column in the table.If foreign key column is not specified and useDBForMapping is set to true in ORMSetting, ColdFusion automatically determines the Foreign Key column after inspecting the database. | |
| lazy | Optional | true | Specifies if loading is to be done lazily: truefalseSee Lazy Loading for details. |
| name | Required | Name of the collection property. | |
| optimisticlock | Optional | true | truefalse |
| orderby | Optional | Specifies the Order By string. | |
| readonly | Optional | false | Value are:truefalseIf you set it to true, the collection never changes and can be cached. |
| structkeycolumn | Required | Column name in the table that will be used as key of struct. | |
| structkeyType | Required | Specifies the data type of the key, when type=struct. For the entire list of data types, see the Data Type section. | |
| table | Required | Name of the table from where the collection will be fetched. | |
| type | Optional | array | Specifies if the collection type is: arraystruct |
<cfcomponent persistent="true" table="Payment" discriminatorColumn="paymentType"> <cfproperty name="id">
<cfproperty name="amount">
</cfcomponent><cfcomponent persistent="true" extends="Payment" table="Payment" discriminatorValue="CCard">
<cfproperty name="cardNo">
<cfproperty name="cardType">
</cfcomponent><cfcomponent persistent="true" extends="Payment" table="Payment" discriminatorValue="check">
<cfproperty name="checkNo">
<cfproperty name="bankName">
<cfproperty name="city">
</cfcomponent>| <cfcomponent persistent="true" table="Payment" discriminatorColumn="paymentType"> <cfproperty name="id"> <cfproperty name="amount"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="Payment" discriminatorValue="CCard"> <cfproperty name="cardNo"> <cfproperty name="cardType"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="Payment" discriminatorValue="check"> <cfproperty name="checkNo"> <cfproperty name="bankName"> <cfproperty name="city"> </cfcomponent> |
| <cfcomponent persistent="true" table="Payment"> <cfproperty name="paymentId"> <cfproperty name="amount"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="CreditCardPayment" joinColumn="paymentId"> <cfproperty name="cardNo"> <cfproperty name="cardType"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="CheckPayment" joinColumn="paymentId"> <cfproperty name="checkNo"> <cfproperty name="bankName"> <cfproperty name="city"> </cfcomponent> |
| <cfcomponent persistent="true" table="Payment" discriminatorColumn="paymentType"> <cfproperty name="paymentId"> <cfproperty name="amount"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="CreditCardPayment" joinColumn="paymentId" discriminatorValue="CCard"> <cfproperty name="cardNo"> <cfproperty name="cardType"> </cfcomponent> |
| <cfcomponent persistent="true" extends="Payment" table="CheckPayment" joinColumn="paymentId" discriminatorValue="Check"> <cfproperty name="checkNo"> <cfproperty name="bankName"> <cfproperty name="city"> </cfcomponent> |
| The embedded object cannot be a persistent object. This feature is supported only when the hibernate mapping is explicitly defined in the hibernate mapping file (.hbmxml files). |
| <cfcomponent embedded="true"> <cfproperty name="FirstName"> <cfproperty name="LastName"> <cfproperty name=" Title"> </cfcomponent> |
| <cfcomponent persistent="true"> <cfproperty name="EmployeeID"> <cfproperty name="EmployeeName"> <cfproperty name="Designation"> </cfcomponent> |
| <hibernate-mapping > <class name="cfc:Employee" table="Employees"> <id name="EmployeeID" type="integer" column="EmployeeID"> <generator class="native"/> </id> <component name="EmployeeName" class="cfc:Name"> <property name="LastName" type="string" column="LastName"/> <property name="FirstName" type="string" column="FirstName"/> <property name="Title" type="string" column="Title"/> </component> <property name="Designation" type="string" column="Designation"/> </class> </hibernate-mapping> |
| <cfcomponent persistent="true"> <cfproperty name="EmployeeID"> <cfproperty name="EmployeeName"> <cfproperty name= "IMIDs" type="array"> <cfproperty name="Designation"> </cfcomponent> |
| <cfcomponent embedded="true"> <cfproperty name="type"> <cfproperty name="ID"> </cfcomponent> |
| <hibernate-mapping> <class name="cfc:Employee" table="Employees"> <id name="EmployeeID" type="integer" column="EmployeeID"> <generator class="native"/> </id> <property name="EmployeeName" type="string" column="EmployeeName"/> <bag name="IMIDs" table="IMData" lazy="true"> <key column="EmployeeID" /> <composite-element class="cfc:IMData"> <property name="type" type="string" column="Type"/> <property name="ID" type="string" column="ID"/> </composite-element> </bag> <property name="Designation" type="string" column="Designation"/> </class> </hibernate-mapping> |
| <cfscript> employee = EntityNew("Employee"); employee.setEmployeeName("Dan Watson"); imdata1 = new IMData(); imdata1.setType("IMClient1"); imdata1.setID("msngrId1"); imdata2 = new IMData(); imdata2.setType("IMClient 2"); imdata2.setID("msngrId2"); employee.setIMIDs([imdata1, imdata2]); EntitySave(employee); </cfscript> |
| Note: Hibernate uses outer join by default for join fetching. For inner join, use HQL. |
| <cfcomponent persistent="true"> <cfproperty name="id"> <cfproperty name="name"> <cfproperty name="houseno" column="houseno" table="Address" joincolumn="addressId"> <cfproperty name="street" table="Address" joincolumn="addressId"> <cfproperty name="city" table="Address" joincolumn="addressId"> <cfproperty name="country" table="Address" joincolumn="addressId"> </cfcomponent> |