Adobe COLDFUSION 9 Manual page 579

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
ColdFusion ORM
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class lazy="true" name="cfc:artGallery.Art" schema="APP" table="Art">
<id name="artid" type="int">
<column length="10" name="ARTID"/>
<generator class="identity"/>
</id>
<property name="artname" type="string">
<column length="50" name="ARTNAME"/>
</property>
<property name="price" type="java.math.BigDecimal">
<column length="19" name="PRICE"/>
</property>
<property name="largeimage" type="string">
<column length="30" name="LARGEIMAGE"/>
</property>
<property name="mediaid" type="int">
<column length="10" name="MEDIAID"/>
</property>
<property name="issold" type="boolean">
<column length="5" name="ISSOLD"/>
</property>
<many-to-one class="cfc:artGallery.Artists"
</class>
</hibernate-mapping>
Mapping CFCs without properties
If a persistent CFC has no property, all table columns are added as properties provided that the table exists and you
have specified it.
Example
Artist.cfc
component persistent="true" table="artists"
{
}
index.cfm
<cfset artists = entityLoad("Artist")>
<cfdump var="#artists#">
The columns are fetched only as column properties. Relationship, timestamp, or version field are not added.
Limitations
• If the mapping file for the CFC exists, then the properties are not added automatically.
• In the case of inheritance, properties are not added to the CFC automatically.
column="artistid" name="artist"/>
Last updated 8/5/2010
574

Advertisement

Table of Contents
loading

Table of Contents