#1 2017-11-29 22:22:00

factor200x
Member
Registered: 2017-05-23
Posts: 15

Question / Problem with the inheritance of TSQLRecord and TSQLRecordHi

Hello, everyone,

first of all I would like to thank you for providing the framework! I have worked my way through a few weeks now and am more than enthusiastic!!

My question/problem:

I have the following definition for my table (here a simple example):

type
  TSQLRecordTimeStamped = class(
    TSQLRecord )
  private
    fUsername:  RawUtf8;
  published
    property Username: RawUtf8 read    fUsernamewrite   fUsername;
  end;


type
  TSQLTitle = class(
    TSQLRecordTimeStamped )
  private
    fName:   RawUtf8;
  published
    property Name: RawUtf8     read    fName     write   fName;
  end;


Create model:

model.create(    TSQLRecordHistory,    TSQLTitle);

Enable History:

database.TrackChanges( [ TSQLTitle ] );

Everything's going great. I just have a problem. When a record is changed, only the value of the Name field is logged. The value of the field "Username" (inherited field) is not logged.

Am I doing something wrong or do I have a mental error?

Thank you in advance
Olaf

Offline

#2 2017-11-29 22:25:04

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

Re: Question / Problem with the inheritance of TSQLRecord and TSQLRecordHi

Only the changed field is stored, IIRC.
Are you sure the Username field was also changed during your tests?

Online

Board footer

Powered by FluxBB