You are not logged in.
Pages: 1
Hi
I have new classes for computing fields: TSQLRecordFillComputed and TSQLComputedRecord. Two possibilities:
1. OnCompute event in TSQLComputedRecord can be used only after "CreateAndFillPrepare" constructor.
2. Custom TSQLRecordFillComputed by overriding ComputeFieldsAfterFill + custom TSQLRecord by overriding RecordFillClass
patch attached:
https://drive.google.com/file/d/0B4PZhd … sp=sharing
best regards,
Maciej Izak
best regards,
Maciej Izak
Offline
Any chance to merge? (or to implement some similar solution?)
best regards,
Maciej Izak
Offline
ping? Maybe TSQLComputedRecord is not perfect but TSQLRecordFillComputed can be merged (even without OnCompute event)...
I need only ComputeFieldsAfterFill from TSQLRecordFillComputed in trunk...
best regards,
Maciej Izak
Offline
Offline
I'd like to have comparable feature to existing ComputeFieldsBeforeWrite but for "After Read". Why we have ComputeFieldsBeforeWrite? I see lack in framework for something like "ComputeFieldsAfterRead".
best regards,
Maciej Izak
Offline
Because you can just define a getter method for computed fields.
See http://synopse.info/files/html/Synopse% … #TITLE_103
Offline
Yes I know. I read it several times and IMO mORMot is incomplete in this matter. In my case it is not "just" defining of "few" getters Lack of something like "After Read/Fill" is big problem. I don't get why we have ComputeFieldsBeforeWrite and we don't have Compute from other perspective like "ComputeFieldsAfterRead".
It is like saying that I need only "finalize" section without "initialize" because I can do the same things just after main begin keyword >.<. I need equivalent of
procedure Loaded; virtual;
from TComponent which is called after loading all properties from dfm stream. Using "getters" is not the same like collective event after "fill".
best regards,
Maciej Izak
Offline
ComputeFieldsBeforeWrite is there to fill the TModTime and TCreateTime fields before insertion, on the client side.
It is not what you expect, for sure!
Why not write a SOA service to return the data as expected, leaving the ORM alone from anything but values persistence?
Offline
Thanks for advice. After small redesign, my code seems more solid. Hmmm.
best regards,
Maciej Izak
Offline
Pages: 1