Fetching images stored as files on server

Hi, I've been handed a job where the data for the larger objects such as Images and PDF's etc are stored in a folder, and the database has a reference to the files along the lines of. Similar to the way a lot of webservers store the file in a folder ad the MySQL DB doesnt hold the BLOBs as such.

ID    Int
OwnerID  Int
OriginalFileName   Varchar
StoredFileName  Varchar

I was planning on putting it into an object along the lines of

  [Entity, Automapping]
  [Id('FId', TIdGenerator.IdentityOrSequence)]
  TBlobObject = Class
  private
    FID: integer;
    FOwnerID: Integer;
    FOringinalFileName: String;
    FStoredFileName: String;
    FData: TArray<byte>;
  published
    property ID: integer read FID write FID;
    property OwnerID: Integer read FOwnerID write FOwnerID;
    property OringinalFileName: String read FOringinalFileName write FOringinalFileName;
    property StoredFileName: String read FStoredFileName write FStoredFileName;
    property Data: TArray<byte> read FData write FData;
  End;

But I cannot figure out how to tell Aurelius / Xdata to load the blob from a file called xxxx when I try to fetch the object. Can you tell the lazy loading to fetch from a file?

They want local access (ie plain Aurelius) without a server running (XData/RemoteDB) as well as running multiple clients, which I was planning on either RemoteDB, or XData.

I plan on using MySQL for the DB.

You can't tell lazy loading to fetch from a file, but you can simply create a public property with a getter that does that for you, for example:

function TBlobObject.GetData: TArray<Byte>;
begin
  Result := LoadDataFromFile(StoredFileName);
end;

   property Data: TArray<byte> read GetData;