Hi Wagner,
Did you introduce a breaking change to Aurelius 5.25.0.1 to force abstract entities to have an ID? Some of my ID fields are GUID and some are integer. I have a base abstract class for timestamps for inserted and modified. I was using a class without an id as a common ancestor but since upgrading this morning my code won’t run
`First chance exception at $746CAE4F. Exception class EMappingNotFound with message 'Cannot find mapping [Id] on class TBaseEntityServer.'.`
It’s not a big problem to have two base classes.
Regards
Steve
type
{$RTTI EXPLICIT METHODS([vcPrivate..vcPublished])}
[ AbstractEntity ]
TBaseEntityServer = class
private
[ Column( 'CREATED_AT', [ TColumnProp.NoUpdate, TColumnProp.Required ] ) ]
FCreatedAt: TDateTime;
[ Column( 'LAST_MODIFIED', [ TColumnProp.Required ] ) ]
FLastModified: TDateTime;
[ OnInserting ]
procedure OnInserting( Args: TInsertingArgs );
[ OnUpdating ]
procedure OnUpdating( Args: TUpdatingArgs );
public
property CreatedAt: TDateTime read FCreatedAt write FCreatedAt;
property LastModified: TDateTime read FLastModified write FLastModified;
end;
implementation
{ TBaseEntityServer }
procedure TBaseEntityServer.OnInserting( Args: TInsertingArgs );
begin
FCreatedAt := TDateTime.NowUTC;
FLastModified := TDateTime.NowUTC;
end;
procedure TBaseEntityServer.OnUpdating( Args: TUpdatingArgs );
begin
FLastModified := TDateTime.NowUTC;
Args.RecalculateState := True;
end;