TBlob Record
Represents a binary large object (blob) that can be mapped to a database blob column by TMS Aurelius.
Remarks
Use TBlob as the type of a field or property in an entity class to map it to a blob column in the database. Compared to using a plain TArray<byte>, TBlob adds support for lazy-loading and provides convenience accessors for reading and writing the binary content as strings or byte arrays.
When the column is declared with TColumnProp.Lazy, Aurelius does not fetch the blob data together with the rest of the entity.
The content is retrieved from the database on demand, the first time any data accessor (AsBytes, AsString, AsUnicodeString, Size, etc.) is used.
TBlob implicitly converts to and from TBytes, so it can be passed directly to methods that accept a byte array.
Syntax
Unit: Aurelius.Types.Blob
TBlob = record;
Constructors
| Name | Description |
|---|---|
| Create | Creates a TBlob and initialises it with the provided byte array. |
Methods
| Name | Description |
|---|---|
| Clear | Clears the blob content, setting it to an empty (null) state. |
| LoadFromStream | Loads the blob content from a stream, replacing any existing data. |
| SaveToStream | Writes the blob content to a stream. |
Operators
| Name | Description |
|---|---|
| Implicit Conversion | Overloaded Implicit conversion from TBlob to TBytes Implicit conversion from TBytes to TBlob |
Properties
| Name | Description |
|---|---|
| AsBytes | Gets or sets the blob content as a TBytes byte array. |
| AsString | Gets or sets the blob content as an ANSI-encoded string. |
| AsUnicodeString | Gets or sets the blob content as a Unicode string. |
| Available | Indicates whether the blob content is available in memory without requiring a database request. |
| IsNull | Gets or sets whether the blob is empty (contains no data). |
| Loaded | Indicates whether the blob content has already been loaded from the database. |
| Size | Returns the size of the blob content in bytes. |