For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
CFML Reference / 

EntityLoad

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Description

Loads 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.

Returns

Array (if unique=false)Single entity (if unique=true)

Category

ORM functions

Function syntax

EntityLoad (entityname)
EntityLoad (entityname, id [, unique])
EntityLoad (entityname, filtercriteria [,unique]
EntityLoad(entityname, filtercriteria, sortorder [, options])

See Also

EntityLoadByExample, EntityReload, EntityDelete

Parameters

Parameter

Description

entity name

Name of the entity to be loaded.

ID

The primary key value of the entity that must be loaded.
If the entity has a composite key, then the id has to be specified as key-value pairs (ColdFusion struct).

unique

If unique is set to true, then the entity is returned. If you are sure that only one record exists that matches this filtercriteria, then you can specify unique=true, so that a single entity is returned instead of an array. If you set unique=true and multiple records are returned, then an exception occurs.

filtercriteria

Key-value pair (ColdFusion Struct) of property names and values. If there are more than one key-value pair, then the AND operator is used.
If specified, loads and returns an array of entities of the specified entity name that matches the filtercriteria.

sortorder

String used to specify the sortorder of the entities that are returned.
If specified, loads and returns an array of entities that satisfy the filtercriteria sorted as specified by the sortorder.

options

The following options to customize the output:

  • ignorecase: Ignores the case of sort order when set to true. Use only if you specify the sortorder parameter.
  • offset: Specifies the position from which to retrieve the objects.
  • maxResults: Specifies the maximum number of objects to be retrieved.
  • cacheable: Whether the result has to be cached in the secondary cache. Default is false.
  • cachename: Name of the cache in secondary cache.
  • timeout: Specifies the timeout value (in seconds) for the query.

History

ColdFusion 9: Added this function.

Usage

For pagination, you can use the options offset and maxResults as shown in the example:

EntityLoad('employee', {department='qa'} , {offset=21, maxResults=10})

This example retrieves the (next) 10 objects of employees whose department is qa from offset 22.

Example

Example with only entity name specified:

<cfset employees = EntityLoad('employee')>

Example with EntityName, id, and unique set to true. Instead of true, if you set unique as false, then array is returned with one entity.

<cfset employee = EntityLoad('employee', 100, true)>
Entity name, composite key.
<cfset orderDetail = EntityLoad('orderdetails', {OrderID=100, ProductID=1}, true)>

Example which describes how to retrieve objects whose country is UK, and sorted by Department ascending and Age descending:

<cfset employeesInUKSorted = EntityLoad('employee',
{country="UK"}, "Department Asc, Age Desc")>

Example that describes how to retrieve details of all the employees who live in 'UK':

<cfset employeesFromUK = EntityLoad('employee', {country="UK"}>

Example that describes how to retrieve a unique object. If you specify unique= "true" and more than one object satisfies the condition, then an exception occurs.

<cfset employee = EntityLoad('employee', {firstname="Marcia", lastname="Em"}, "true")>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices