Kitto.InstantObjects.Utils
TInstantKittoConnector class
Bridge between Kitto and InstantObjects persistence. Reuses the per-request cached TKConfig.Database connection — InstantObjects rules share the same TFDConnection as the rest of the request, avoiding lock contention from parallel connections of the same user. Must be created and destroyed inside a single unit of work: it does NOT own the TEFDBConnection, only the TInstantFireDACConnector wrapper.
property Connector: TInstantFireDACConnector read GetInstantFireDACConnector;The InstantObjects connector wrapping the request's shared TKConfig.Database connection.
Routines
function RetrieveOrCreateInstantObject(const AClassName, AId: string;Retrieves the InstantObject of the given class and id, creating a new one if it does not exist. Uses AConnector, or the current one if nil.
function TKRecordToInstantObject(ARecord : TKRecord ) : TCBInstantObject;Creates/loads and populates an InstantObject from the values of a Kitto store record.
procedure InstantObjectToTKRecord(AInstantObject : TCBInstantObject;Copies the persistent property values of an InstantObject into a Kitto store record.
procedure InstantObjectBeforeStore(AInstantObject : TCBInstantObject) ;Hook run before storing an InstantObject (e.g. to assign the id / apply defaults).
