Object-relational mapping



  • EntityDelete Deletes the record from the database for the specified entity. EntityDelete(entity)
  • EntityLoad Loads and returns an array of entities of the specified entityname.
  • EntityLoadByExample Loads and returns an array of objects that match the sample entity.
  • EntityLoadByPK Loads and returns an array of objects for given primary key.
  • EntityMerge Attaches given entity to current ORM session
  • EntityNameArray return all loaded entities as array
  • EntityNameList return all loaded entities as string list
  • EntityNew Creates a new instance of the persistent CFC with the entity name that you provide.
  • EntityReload Reloads data for an entity that is already loaded.
  • EntitySave Saves or updates data of the entity and all related entities to the database.
  • EntityToQuery Converts the input entity object or the input array of entity objects to a query object.
  • ORMClearSession Removes all the entities that are loaded or created in the session.
  • ORMCloseAllSessions Closes all ORM session.
  • ORMEvictCollection This will remove all the entries with the specified relation/collection name in the specified component.
  • ORMEvictEntity This will remove all the entries for the specified component name from the entity cache.
  • ORMEvictQueries This will remove all the queries from the named query cache.
  • ORMExecuteQuery Runs the HQL on the default data source specified for the application.
  • ORMFlush Flushes the current ORM session.
  • ORMGetSession Returns the current ORM session
  • ORMGetSessionFactory Returns ORM session factory instance
  • ORMReload Returns ORM session factory instance
  • TransactionCommit commits a pending transaction
  • TransactionRollback rolls back a pending transaction
  • TransactionSetSavePoint Saves a specific state within a transaction


  • ORM:first_example ## First example ## Let's have a look at a simple example where we want to persist a certain CFC to a MySQL database. Further below all necessary steps in order to get ORM to work with Lucee are described. We will assume the following scenario: We have an easy blog where an author can submit his blog post containing the following properties for an entry: * author * publish date * title * teaser * text * tags Nothing more for the moment
  • ORM:introduction ### ORM with Lucee ### This section is going to describe how ORM (object relational mapping) is handled by Lucee 3.2 Server. Lucee Server uses Hibernate in the background for implementing ORM. If you want to learn more about Hibernate, just check the corresponding [documentation](http://www.hibernate.org/). ### What is ORM ? ### According to Wikipedia ORM is: Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages


  • <cftransaction> Groups multiple queries into a single unit. The cftransaction tag provides commit and rollback processing.

See also