TAureliusDataSet.OnObjectUpdate not working

I have created a component that is direct descendant from TAureliusDataSet.

I made this to override the 4 events introduced by TAureliusDataset:

  OnCreateObject := NewCreateObject;
  OnObjectInsert := NewObjectInsert;
  OnObjectUpdate := NewObjectUpdate;
  OnObjectRemove := NewObjectRemove;

Then for each one I use this:

procedure TNaharDataSet.NewObjectUpdate(Dataset: TDataSet; AObject: TObject);
  Model.SaveOrUpdate(AObject as TNaharEntity);

and this Model is defined like this:

procedure TNaharModel.SaveOrUpdate(Entity: TObject);
  (Entity as TNaharEntity).Action(eaBeforeSave);
  ProcessUpdate(Entity as TNaharEntity);

where the OManager is the TObjectManager.

For insert and remove everything works. The entity is created/deleted on the database.

Now the OnObjectUpdate that I use SaveOrUpdate from TObjectManager is not UPDATING the entity on the database.

I can change anything on the entity and nothing happens. The fields are showing on the form correctly.

I can add new records and it gets saved. 

Tracking the execution, it is calling the TObjectManager.SaveorUpdate as expected.

For some reason, Aurelius is not persisting. This is the entity snip:

  [Id('ID', TIdGenerator.Guid)]
  TEntityUnidadeOrg = class(TNaharEntity)
    FId: TGuid;
    [Column('ID', [TColumnProp.Unique, TColumnProp.Required, TColumnProp.NoUpdate])]
    property  Id: TGuid read FId write FId;

What could be that is not triggering the Updating in Aurelius?



You should call OManager.Flush to perform the changes made to objects (update).