ColdFusion 9.0 Resources |
EntityLoad with entityname and filtercritieriaDescriptionLoads and returns an array of entities of the specified entity name that matches the filtercriteria. If there are more than one key-value pair in filtercriteria, then the AND operator is used. 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. ReturnsArray (by default) Single entity (when unique = true) CategoryFunction SyntaxEntityLoad (entityname, filtercriteria [,unique] See AlsoEntityLoad with entityname, EntityLoad with entityname and ID, EntityLoad with entityname, filtercriteria, and sortorder Parameters
ExamplesTo retrieve details of all the employees who live in ‘UK’: <cfset employeesFromUK = EntityLoad('employee', {country="UK"}> To retrieve a unique object, specify unique= "true". If more than one object satisfies the condition, an exception occurs. <cfset employee = EntityLoad('employee', {firstname="Marcia", lastname="Em"}, "true")> |