Event Handling in CFC

ORM provides callbacks to the event listeners for all the persistence events like Load, Insert, Update, Delete. These events can be used for data validations or transformation or for some generic functions such as auditing. These events can be handled at two levels in ColdFusion ORM:

  • In a persistent CFC

  • Using an event handler CFC

To enable event handling for an application, define the following setting: ormsettings.eventhandling= “true"

By default, this flag is disabled. If you do not specify this flag while the event handler CFC is defined, the flag is considered as enabled.