Show/Hide Toolbars

TMS Aurelius Documentation

When declaring blob attributes in your class, you can configure them for lazy-loading. It means that whenever Aurelius tries to retrieve an object from the database, it will not include the blob field in the select, and thus the blob content will not be sent through network from server to client unless it's needed. If you access the blob content through the blob property, then Aurelius will execute an SQL statement on-the-fly only to retrieve the blob content.


To map the blob property/field as lazy, you just need two requirements:


1. Use the TBlob type as the field/property type.

2. Add TColumnProp.Lazy to the column properties in the Column attribute.


The code below indicates how to declare a lazy-loaded blob:


TTC_Customer = class
strict private
  // <snip>
  [Column('Photo', [TColumnProp.Lazy])]
  FPhoto: TBlob;


The TBlob type is implicitly converted to an array of byte but also have methods for retrieving the blob content as TBytes, string, etc.. Whenever you try to access the blob data through the TBlob type, the blob content will be retrieved from the database.