Skip to main content

BlobAttribute Class

Indicates if a table column to which a string or BLOB data field/property of an entity class is mapped stores Memo or BLOB data.

Declaration

BlobAttribute = class(
    TCustomAttribute
)

Remarks

With this attribute, the mapped column’s type and size are sufficient for storing Memo or BLOB data. They are specific to the database within which a session component creates the entity model’s schema.

The following code configures an entity class to store TdxSmartImage object with the Photo property using the BlobAttribute:

uses
  ..., dxEMF.Core, dxEMF.Attributes, dxGDIPlusClasses;
type
  [Entity]
  [Automapping]
  TPerson = class
  strict private
    FId: Integer;
    [Blob]
    FPhoto: TdxSmartImage;
  public
    constructor Create;
    destructor Destroy; override;
    property Id: Integer read FId;
    property Photo: TdxSmartImage read FPhoto write FPhoto;
  end;
// ...
implementation
constructor TPerson.Create;
begin
  inherited Create;
  FPhoto := TdxSmartImage.Create;
end;
destructor TPerson.Destroy;
begin
  FreeAndNil(FPhoto);
  inherited Destroy;
end;

Inheritance

See Also