I'm hitting an error with Inheritance, when I have two child classes off a base class. Each of these two child classes happen to have a field that has the same name, that is an association.
[Entity]
[Automapping]
[Inheritance(TInheritanceStrategy.JoinedTables)]
TBaseClass = class
private
FId: Integer;
FBaseData: Integer;
public
property Id: Integer read FId write FId;
property BaseData: Integer read FBaseData write FBaseData;
end;
[Entity]
[Automapping]
TChild2 = class(TBaseClass)
private
FChild2Data: Integer;
FItem: TAssocItem;
public
property Child2Data: Integer read FChild2Data write FChild2Data;
property Item: TAssocItem read FItem write FItem;
end;
[Entity]
[Automapping]
TChild3 = class(TBaseClass)
private
FChild3Data: Integer;
FItem: TAssocItem;
public
property Child3Data: Integer read FChild3Data write FChild3Data;
property Item: TAssocItem read FItem write FItem;
end;
[Entity]
[Automapping]
TAssocItem = class
private
FAssocData: Integer;
FId: Integer;
public
property AssocData: Integer read FAssocData write FAssocData;
property Id: Integer read FId write FId;
end;
If I run a findall<TBaseItem> I get a runtime error 'EListError, Duplicates not allowed' originating in the procedure TSelecter.AddPathMapEntry(APath: string). Looking at the callstack, it appears to be in the middle of calling AddJoin for the association on the second child class.
If I have a duplicate field that is not an association, I do not get the error.
Code for a test case is at my Dropbox.
Thank you for reporting. We have fixed this issue and sent you an e-mail with the patch. Fix will be officially included in next Aurelius release.