existsLookup¶
Finds a persisted entity from storage (e.g. RDBMS, Document Store, Big Data, cache) based on a key search.
Given entity types are stored based on a key, an existsLookup function and fetch the entity
with a matching key. This operation is expected to be fast given its a primary-key based fetch with
the option of being cached.
Parameters:
| No. | Type | Comments | 
|---|---|---|
| 1 | entity | The entitytype being queried | 
| 2 | key | The key to search for an entity | 
Returns:
An optional entity type specified as the 1st argument.
If no match found, a none value returned.
Usages:
- existsLookup( <entity type>, <key instance> ) : boolean- Object returned is optional
Example:
- let found = existsLookup( Order, new OrderKey(orderId) )Checks existence given an id string.