The tag cfcomponent defines a persistent CFC by setting persistent="true". It allows you to specify various other mappings for a persistent CFC.
If your persistent CFC has init method, ensure that either it has no arguments or all arguments are optional.
Syntax
<cfcomponent accessors= "yes|no" persistent="true|[false]" entityname="entity_name" table="table_name" schema="schema" catalog="catalog" dynamicInsert="true|[false]" dynamicupdate="true|[false]" readonly="true|[false]" selectbeforeupdate="true|[false]" discriminatorvalue="discriminator_value" discriminatorcolumn="discriminator_column" joincolumn="join_column" cacheuse="read-only|read-write|nonstrict-read-write|transactional|[none]" cachename="cache_name" batchsize="batchsize" optimisticLock="none|[version]|dirty|all" lazy="[true]|false" savemapping="true|false">
Attributes
Attribute | Req/Opt | Default | Description |
---|---|---|---|
accessors | true | If set to false, ColdFusion ORM does not generate the implicit getters and setters. |
|
batchsize | Optional | 1 | An integer value that specifies the number of records to be retrieved at a single instance. For details, see Lazy Loading. |
cachename | Optional | Use this value to specify the name of the secondary cache. See Caching for details. | |
cacheuse | Optional | none | 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. |
catalog | Optional | Used to specify the database catalog name. | |
discriminatorcolumn | Optional | Use this attribute to define the discriminator column to be used in inheritance mapping. See Inheritance mapping in Advanced mapping for details. | |
discriminatorvalue | Optional | Use this attribute to define the discriminator value to be used in inheritance mapping. See Inheritance mapping in Advanced mapping for details. | |
dynamicInsert | Optional | false | Whether INSERT SQL is to be generated at runtime:
|
dynamicupdate | Optional | false | Whether UPDATE SQL is to be generated at runtime:
|
entityname | Optional | Name of the CFC | Specifies the name of the entity. Entity name is the name used by the ORM related functions to work with the persistent CFC. If entityname is not specified, then the CFC name is taken as the entityname . The entityname must be unique in the application. |
joincolumn | Optional | Use this attribute to define the join column for inheritance mapping. See Inheritance mapping for details. | |
lazy | Optional | true | Whether loading is to be done lazily:
|
optimisticLock | Optional | version | Determines the locking strategy. It can be any one of the following four values:
|
persistent | Required | false | Whether the CFC is a persistent CFC:
|
readonly | Optional | false | Whether the table is read-only:
|
savemapping | Optional | Saves the generated Hibernate mapping file to the disk.If you have set savemapping for the application, then the value you set here overrides it. | |
schema | Optional | Used to specify the schema name. | |
selectbeforeupdate | Optional | false | Whether Hibernate should never perform an SQL UPDATE unless it is certain that an object is actually modified:
|
table | Optional | Name of the CFC | Specifies the name of the database table to which the CFC maps. |