Hello!
I have a problem with AbstractEntities. I have an existing class TPartner that I want to convert to a inheritence from a common class, here's the code:
[Entity]
[Table('partners')]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TPartner = class(TBaseObject)
private
[Column('ID')]
FId: integer;
[Column('NAME')]
FPartnerName: string;
public
property Id: integer read FId write FId;
property PartnerName: string read FPartnerName write FPartnerName;
end;
Here's the new code that doesn't work, the error on run-time is
---------------------------
Debugger Exception Notification
---------------------------
Project Easy.exe raised exception class EMappingNotFound with message 'Cannot find mapping [Id] on class TPartner.'.
I've checked the documentation in the PDF manual (page 45) and it seems the same to me, bout obviously I'm missing something here..
The new code is this:
TBaseObject = class
private
[Transient]
FIsNew: boolean;
[Transient]
FErrors: TStringList;
[Transient]
FSelected: boolean;
[Transient]
FSkipProcessing: boolean;
[Transient]
FChanged: boolean;
public
property Selected: boolean read FSelected write FSelected;
property IsNew: boolean read FIsNew write FIsNew;
property Errors: TStringList read FErrors write FErrors;
property Skip: boolean read FSkipProcessing write FSkipProcessing;
property Changed: boolean read FChanged write FChanged;
end;
[AbstractEntity]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TEasyBase = class(TBaseObject)
strict private
[Column('ID')]
FId: integer;
public
property Id: integer read FId write FId;
end;
[Entity]
[Table('partners')]
TPartner = class(TEasyBase)
private
[Column('NAME')]
FPartnerName: string;
public
property PartnerName: string read FPartnerName write FPartnerName;
end;