Hello,
following suggestions from Wagner Landgraf in reply to a previous request of mine:
I have prepared a TSeqEntity abstract class with [OnInserting] and [OnUpdating] attributes - this class has the directive {$RTTI EXPLICIT METHODS([vcPrivate..vcPublished])}
Then, Tcom_plants = class(TSeqEntity) - which inherits from TSeqEntity correctly inherits the createdAt & updatedAt properties... but no event is fired from the parent class.
I've also tried to debug code in Delphi 11.3... but the breakpoints are green - that's a signal that the code is never reached... any suggestion?
I'm attaching a sample project, it's based on MySQL (you can create db with SQL/tms_test.sql - credentials sysdba:masterkey).
I have kept everything as-is from TMS XData VCL Server wizard, just added FDConnection1 and the two files.
DefaultEntitySetPermissions all true - the idea is to test via SwaggerUI.
PATCH does not update updatedAt field (I've tried calling it with body { "isActive": 0 } )
PUT fails to insert a new record "[FireDAC][Phys][MySQL] Field 'createdAt' doesn't have a default value"
if the the RTTI directive is put on top (before unit name declaration) the compiler gives this message [dcc32 Error] CTS.Entities.SEQ.CrAt_UpAt.pas(1): E2609 RTTI directive must be used after PROGRAM, UNIT or LIBRARY header
the solution was then to put the directive just after unit and before interface sections.