Whatever message this page gives is out now! Go check it out!

Map a ColdFusion component

Last update:
Jun 9, 2026
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

AttributeReq/OptDefaultDescription
accessorstrue 
If set to false, ColdFusion ORM does not generate the implicit getters and setters.
batchsizeOptional1An integer value that specifies the number of records to be retrieved at a single instance. For details, see Lazy Loading.
cachenameOptional Use this value to specify the name of the secondary cache. See Caching for details.
cacheuseOptionalnoneUse this value to specify the caching strategy to be used for caching this component's data in the secondary cache. See Caching for details.
catalogOptional Used to specify the database catalog name.
discriminatorcolumnOptional Use this attribute to define the discriminator column to be used in inheritance mapping. See Inheritance mapping in Advanced mapping for details.
discriminatorvalueOptional Use this attribute to define the discriminator value to be used in inheritance mapping. See Inheritance mapping in Advanced mapping for details.
dynamicInsertOptionalfalse
Whether INSERT SQL is to be generated at runtime:
  • true
  • false

    Only those columns whose values are not null are included in the SQL.
dynamicupdateOptionalfalse
Whether UPDATE SQL is to be generated at runtime:
  • true
  • false

    Only those columns that have changed values are included in the SQL.
entitynameOptionalName of the CFCSpecifies 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.
joincolumnOptional Use this attribute to define the join column for inheritance mapping. See Inheritance mapping for details.
lazyOptionaltrue
Whether loading is to be done lazily:
optimisticLockOptionalversion
Determines the locking strategy. It can be any one of the following four values:
persistentRequiredfalse
Whether the CFC is a persistent CFC:
  • true
  • false
readonlyOptionalfalse
Whether the table is read-only:
  • true
  • false

    This is inserted by the EntitySave() method.
savemappingOptional 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.
schemaOptional Used to specify the schema name.
selectbeforeupdateOptionalfalse
Whether Hibernate should never perform an SQL UPDATE unless it is certain that an object is actually modified:
  • true
  • false

    In cases when a transient object is associated with a new session using update(), Hibernate performs an extra SQL SELECT to determine if an UPDATE is actually required.
tableOptionalName of the CFCSpecifies the name of the database table to which the CFC maps.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page