EntityLoad with entityname and ID

Description

Loads and returns an entity which has ID as the primary key value.

If unique is true, then the entity is returned. If the entity has a composite key, then the ID has to be specified as key-value pairs (ColdFusion struct).

Returns

Array (by default)

Category

ORM functions

Function Syntax

EntityLoad (entityname, id [, unique])

Parameters

Parameter

Description

entity name

Name of the entity to be loaded.

ID[, unique]

Primary key value being ID.

Examples

<cfset employeeArr = EntityLoad('employee', 100)> 
<cfset employee = EntityLoad('employee', 100, true)> 
<cfset orderDetail = EntityLoad('orderdetails', {OrderID=100, ProductID=1}, true)>