EntitytoQuery

Description

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

Returns

Query

Category

ORM functions

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.

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)>