Hi, im trying to load a subproperty field in the TAureliusDataset. This is my class:
[Model('default')]
[Model('folha')]
[Entity]
[Table('fol_assistencia')]
[Id('Id', TIdGenerator.IdentityOrSequence)]
TAssistencia = class
strict private
{ Private declarations }
FId : Integer;
FIdUsuario : Integer;
FDataHora : TDateTime;
FCodigo : string;
FDescricao : string;
FUsuario : Proxy<TUsuario>;
public
{ Public declarations }
[Column('id', [TColumnProp.Unique])]
property Id : Integer read FId write FId;
[Column('idusuario')]
property IdUsuario : Integer read FIdUsuario write FIdUsuario;
[Column('datahora')]
property DataHora : TDateTime read FDataHora write FDataHora;
[Column('codigo', [], 2)]
property Codigo : string read FCodigo write FCodigo;
[Column('descricao', [], 75)]
property Descricao : string read FDescricao write FDescricao;
[Association([TAssociationProp.Lazy])]
[JoinColumn('idusuario')]
property Usuario: Proxy<Usuario> read FUsuario write FUsuario;
end;
i used the TObjectManager.FindAll<TAssistencia> to retrieve all the data and after assign to the dataset i create the field encharge for the subproperty as the document says to:
with TStringField.Create(Self) do
begin
FieldName := 'Usuario.Nome';
DataSet := AureliusDataset;
end;
the thing is that the data is not showing at all, this foreign is not null on my database so it should show something.
what i did then was to change my association column to a simple TUsuario instead of Proxy<TUsuario> and it started to show the data.
that lead me to think that maybe the dataset doesnt support or handle the proxy thing correcty? it needs some specific behaviour to work?