Working with Aurelius

Hi,

I'm having an issue when accesing NullAble field from a Aurelis Entity.(Invalid Class TypeCast).

Any hint how to work with Nullable fields in scipt?

Thanks in advance,

Omar Zelaya

Script Code:
...
DBUsuarios := Manager.Find(TUSUARIO2)
.OrderBy('SITUACION')
.OrderBy('CODIGO')
.List;
for i := 0 to DBUsuarios.Count - 1 do
begin
DBUsuario := DBUsuarios.Items[i];
Usuario.ID := DBUsuario.ID;
Usuario.Codigo := DBUsuario.CODIGO;
Usuario.Nombre := DBUsuario.NOMBRE; <- Exception
end;
....

Hi,

One more question. :slight_smile:

Any hint how can I convert the following delphi code to Aurelius script:

var
Results: TObjectList;
...
Results := Manager.Find
.Select(TProjections.ProjectionList
.Add(TProjections.Count('ID').As_('CantLicencias'))
.Add(TProjections.Sum('VALOR').As_('ValorLicencias')))
.Add(TExpression.Eq('ID_USUARIO', AIdUsuario))
.Add(TExpression.Eq('SITUACION', 'A'))
.ListValues;

Thanks in advace,

Omar Zelaya

Maybe this can help?

Hi,

Thanks, I have figured out working with the projection, But still not find out about the Nullable fields(I'm allready using the Aurelius.Scripter.pas file).

Thanks in advance,

Omar Zelaya

The provided unit already handles nullable properties in Aurelius entities.
Did you check it, did you try it, if yes, do you have a specific reproducible case that we should analyze?