#1 2015-09-14 12:34:43

Thomas-Acia
Member
From: Metz (France)
Registered: 2015-04-16
Posts: 79

Setter uncalled in a TSQLRecord class

Hi,

I need to call a Setter in a TSQLRecord class but it's uncalled. Is it because of the TSQLRawBlob type ??

type  
  TSQLAttributesRec = class(TSQLRecord)
  private
      fObjID, fPackedObj, fSize, fUseCount, fUnpackedObj :Integer;
      fExtension, fFilePath, fMimeType, fFName, fSha :RawUTF8;
      fBlob :TSQLRawBlob;
      procedure SetBlob(const Value:TSQLRawBlob);
  published
      property ObjID: Integer Read fObjID Write fObjID;
      property PackedObj: Integer Read fPackedObj Write fPackedObj;
      property Size: Integer Read fSize Write fSize;
      property UseCount: Integer Read fUseCount Write fUseCount;
      property UnpackedObj: Integer Read fUnpackedObj Write fUnpackedObj;
      property Extension: RawUTF8 Read fExtension write fExtension;
      property FilePath: RawUTF8 Read fFilePath write fFilePath;
      property MimeType: RawUTF8 Read fMimeType write fMimeType;
      property Name: RawUTF8 Read fFName write fFName;
      property Sha: RawUTF8 Read fSha write fSha;
      property Blob: TSQLRawBlob read fBlob write SetBlob;
   public
  end;
procedure TSQLAttributesRec.SetBlob(const Value:TSQLRawBlob);
begin
  ...
end;

I looked at this and I noticed that you used another class.

Last edited by Thomas-Acia (2015-09-14 12:38:44)


Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits

Offline

#2 2015-09-14 12:42:49

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,663
Website

Re: Setter uncalled in a TSQLRecord class

When isn't it be called?

AFAIK TPropInfo.SetLongStrProp should call the setter as expected.

Online

#3 2015-09-14 14:18:18

Thomas-Acia
Member
From: Metz (France)
Registered: 2015-04-16
Posts: 79

Re: Setter uncalled in a TSQLRecord class

It's solved, I use now

aAttributes.Blob := aAttributes.Blob;

to call it explicity.

Last edited by Thomas-Acia (2015-09-14 14:48:35)


Delphi 2010 - Delphi XE5 (x64 Apps) - CodeTyphon - Typhon IDE v 5.7 - FPC 3.1.1 - mORMot 1.18
Windows 7 - VirtualBox : Linux Debian 8.5 Jessie 32 bits

Offline

Board footer

Powered by FluxBB