ORM Functions

namedescription
entityDeleteDeletes the record from the database for the specified entity. Depending on the cascade attribute specified in the mapping, it deletes the associated objects also.
entityLoadLoads and returns an array of entities for the specified entity name. You can also specify a filter criteria and sort order. All EntityLoad methods take the entity name as input.
entityLoadByExampleLoads and returns an array of objects that match the sampleentity.The filter criteria is constructed by ANDing all the non-null properties of the sampleentity.
entityLoadByPKLoads and returns an array of objects for the specified primary key. Use this function to avoid specifying the boolean parameter that you must specify with the EntityLoad() function.
entityMergeAttaches the specified entity to the current ORM session. It copies the state of the given object onto the persistent object with the same identifier and returns the persistent object.
entityNewCreates a new instance of the persistent CFC with the entity name that you provide.
entityReloadReloads data for an entity that is already loaded. This method refetches data from the database and repopulates the entity with the refreshed data.
entitySaveSaves or updates data of the entity and all related entities to the database. ColdFusion automatically tries to find if a new record should be inserted or an existing record be updated for the given entity. If you set forceinsert=true, then ColdFusion tries to insert the entity as a new record.
entitytoQueryConverts the input entity object or the input array of entity objects to a query object.
oRMClearSessionORMClearSession removes all the entities that are loaded or created in the session. This clears the first level cache and removes the objects that are not yet saved to the database.
oRMCloseSessionCloses the current ORM session.
oRMEvictCollectionThis method is used to evict all the collection or association data for the given entity name and collection name, from the secondary cache. If the primary key is specified, then, the collection or association data of the entity with the primary key is evicted.
oRMEvictEntityThis method is used to evict items for the given entity name, from the secondary cache. If the primary key is specified, then the data of the entity with that primary key is evicted. Primary key should be a value in case of simple primary key or should be a struct in case of composite primary key.
oRMEvictQueriesThis method is used to evict the data of all the queries from the default query cache. If cache name is specified, then, the data of all the queries belonging to the cache region with the given cache name are evicted.
oRMExecuteQueryExecutes an Hibernate Query Language (HQL) query.
oRMFlushFlushes the current ORM session. ORMFlush flushes all the pending CRUD operations in that request. Any changes made in the objects, in the current ORM session, are saved to the database.
oRMGetSessionReturns the current ORM session (the underlying Hibernate session). Use this session object to call the APIs, which are otherwise not exposed by ColdFusion.
oRMGetSessionFactoryORMGetSessionFactory returns the underlying Hibernate SessionFactory object. For information on Session API see:
oRMReloadReinitializes ORM for the application.