TObjectManager.FindCached<E> Method
Overloads
TObjectManager.FindCached<E>(Variant)
Retrieves an entity of type E from the manager's cache by its identifier, without querying the database.
Remarks
Unlike Find, this method never hits the database.
Syntax
Unit: Aurelius.Engine.ObjectManager
function TObjectManager.FindCached(const IdValue: Variant): E; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| const | IdValue | Variant | The identifier value to look up. |
Returns
The cached entity instance, or nil if the entity is not currently loaded in the manager.
Type Parameters
| Type Parameter | Description |
|---|---|
| E | The entity class type. |
See also
TObjectManager.FindCached(TClass, Variant)
Retrieves an entity of the specified class from the manager's cache by its identifier, without querying the database.
Remarks
Unlike Find, this method never hits the database. It is useful for checking whether an entity is already loaded before performing additional operations.
Use the non-generic overload when the entity class is not known at compile time.
Syntax
Unit: Aurelius.Engine.ObjectManager
function TObjectManager.FindCached(Clazz: TClass; const IdValue: Variant): TObject; overload;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| Clazz | TClass | The runtime class of the entity to find. | |
| const | IdValue | Variant | The identifier value to look up. |
Returns
The cached entity instance, or nil if the entity is not currently loaded in the manager.