HI Wagner,
I'm having some trouble getting a nested dataset to work. I have a TShip class that should have two TLists of Tests and Hatches. The hatches work fine but I can't get an AureliusDataset to recognise the tests even though I have done everything the same. I am using a package to create the field definitions but they are just not there for the tests no matter what I do. And if I create a TDataSetField manually that doesn't help either. Do you have any ides? below is an excerpt of the how the entities are created.
TShip = class(TPersistent)
private
....
[ManyValuedAssociation([TAssociationProp.Lazy], CascadeTypeAllRemoveOrphan , 'FShip')]
FHatches: Proxy<TList<THatch>>;
....
[ManyValuedAssociation([TAssociationProp.Lazy], CascadeTypeAllRemoveOrphan , 'FShip')]
FQualities: Proxy<TList<TQuality>>;
function GetHatches: TList<THatch>;
function GetQualities: TList<TQuality>;
public
property Hatches : TList<THatch> read GetHatches ;
property Tests : TList<TQuality> read GetQualities ;
end;
THatch = class(TLocation)
private
...
[Association([TAssociationProp.Lazy], [])]
[ForeignKey('FK_LOCATIONS_3')]
[JoinColumn('SHIP_ID', [])]
FShip: Proxy<TShip>;
...
function GetShip: TShip;
procedure SetShip(const Value: TShip);
public
property Ship : TShip read GetShip write SetShip;
end;
TQuality = class(TPersistent)
private
...
[Association([TAssociationProp.Lazy], [])]
[ForeignKey('FK_QUALITY_1')]
[JoinColumn('SHIP_ID', [])]
FShip: Proxy<TShip>;
...
function GetShip: TShip;
procedure SetShip(const Value: TShip);
public
property Ship : TShip read GetShip write SetShip;
end;
implementation
function TShip.GetHatches: TList<THatch>;
begin
Result := FHatches.Value;
end;
function TShip.GetQualities: TList<TQuality>;
begin
Result := FQualities.Value;
end;
constructor TShip.Create;
begin
FHatches.SetInitialValue(TList<THatch>.Create);
FQualities.SetInitialValue(TList<TQuality>.Create);
end;
destructor TShip.Destroy;
begin
FHatches .DestroyValue;
FQualities.DestroyValue;
inherited;
end;
function THatch.GetShip: TShip;
begin
Result := FShip.Value;
end;
procedure THatch.SetShip(const Value: TShip);
begin
FShip.Value := Value;
end;
function TQuality.GetShip: TShip;
begin
result := FShip.Value;
end;
procedure TQuality.SetShip(const Value: TShip);
begin
FShip.Value := Value;
end;