How can I access the Parent Entity, without adding a Field to the Child-Entity?
Example:
[Entity, Automapping]
TChild
strict private
FId: Integer;
FName: string;
public
[OnDeleting]
procedure OnDeleting(aArgs: TDeletingArgs);
property Id: Integer read FId;
property Name: string read FName write FName;
end;
[Entity, Automapping]
TParent
strict private
FId: Integer;
FName: string;
[ManyValuedAssociation([TAssociationProp.Lazy], CascadeTypeAllRemoveOrphan)]
[ForeignJoinColumn('PARENT_ID', [])]
FChildren: Proxy<TList>;
function GetChildren: TList;
public
property Id: Integer read FId;
property Name: string read FName write FName;
property FChildren: TList read GetChildren;
end;
procedure TChild.OnDeleting(aArgs: TDeletingArgs);
begin
// How to Access TParent, for changing some Informations?
end;
I tried to add FParentId to TChild, but this raises an error, because UpdateDatabase then tries to add 2 Columns parent_id...
Another try, using DynamicProperties also raises the same error on UpdateDatabase.
I'm searching for this in your docs for a while, but I didn't find anything. (Same for your Demos)