unit Entities;

interface

uses
  SysUtils, 
  Generics.Collections, 
  Aurelius.Mapping.Attributes, 
  Aurelius.Types.Blob, 
  Aurelius.Types.DynamicProperties, 
  Aurelius.Types.Nullable, 
  Aurelius.Types.Proxy, 
  Aurelius.Criteria.Dictionary;

type
  TBlobs = class;

  [Entity]
  [Table('Blobs')]
  [Id('FId', TIdGenerator.IdentityOrSequence)]
  TBlobs = class
  private
    [Column('Id', [TColumnProp.Required, TColumnProp.NoInsert, TColumnProp.NoUpdate])]
    FId: Integer;

    [Column('Name', [], 50)]
    FName: Nullable<string>;

    [Column('Description', [TColumnProp.Lazy])]
    [DBTypeMemo]
    FDescription: TBlob;

    [Column('Photo', [TColumnProp.Lazy])]
    FPhoto: TBlob;
  public
    property Id: Integer read FId write FId;
    property Name: Nullable<string> read FName write FName;
    property Description: TBlob read FDescription write FDescription;
    property Photo: TBlob read FPhoto write FPhoto;
  end;

implementation

initialization
  RegisterEntity(TBlobs);
end.
