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

EntityToQuery

Last update:
May 18, 2026

Description

Converts the input entity object or the input array of entity objects to a query object.

Returns

Query

Category

Function Syntax

EntityToQuery (orm_object, [entity_name]) 

EntityToQuery (orm_object_array, [entity_name])

Parameter

Parameter
Description
orm_object
Entity object that needs to be converted to a query object.
orm_object_array
Array that needs to be converted to a query object.
entity_name
Name of the entity. Use this optional parameter to return the query of the given entity in the case of inheritance mapping.

See Also

History

ColdFusion 9: Added this function.

Usage

The following conditions apply for this function:
  • In the case of array input, all objects in the array must be of the same type.
  • The result query will not contain any relation data.

Example

<cfset artists = EntityLoad("Artist")> 

<cfset artistQuery = EntityToQuery(artists)>

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