Have this code that used to work on older versions of Aurelius on Delphi 10.3. Now, trying to run with newest version of Aurelius on Delphi 10.4 raises an exception: "Cannot find mapping [Id] on class TDerivedClass"
Here is the (pseudo)code:
[Entity]
[Table('BASE_TABLE')]
[Sequence('ID_BASE_TABLE')]
[Inheritance(TInheritanceStrategy.SingleTable)]
[DiscriminatorColumn('CLASSE', TDiscriminatorType.dtInteger)]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TBaseClass = class (TSomeCustomObject)
private
[Column('ID', ColumnPropPrimaryKey)]
FId: TId;
{...}
[Entity]
[DiscriminatorValue(Ord(TClasse.Classe1))]
TDerivedClass = class (TBaseClass)
{
Fields with no FId field already defined on TBaseClass
}
Digging deeper I found an specific scenario where the problem occurs:
TBaseClass cannot have a link to TDerivedClass, like that:
TDirivedClass = class;
[Entity]
[Table('BASE_TABLE')]
[Sequence('ID_BASE_TABLE')]
[Inheritance(TInheritanceStrategy.SingleTable)]
[DiscriminatorColumn('CLASSE', TDiscriminatorType.dtInteger)]
[Id('FId', TIdGenerator.IdentityOrSequence)]
TBaseClass = class (TSomeCustomObject)
private
[Column('ID', ColumnPropPrimaryKey)]
FId: TId;
[Association([TAssociationProp.Lazy])]
[JoinColumn('SOME_COLUMN')]
FDerived: Proxy<TDerivedClass>; // Here is the problem (don't know if by design)
{...}