#1 2012-06-01 08:44:21

lele9
Member
Registered: 2011-10-28
Posts: 170

from trigger to delphi code

hi ab,
i finish to write my first real (very simple) application with orm, so it's time to refactoring!
i could need to update some tsqlrecord property/ modify / or add tsqlrecord when i add/update/delete some other tsqlrecord.
for example i'm thinking about insert/update/delete an invoice must update other tsqlrecord like article, store, customer...
i read this http://synopse.info/forum/viewtopic.php?id=342
and its interesting but its that i would if i thinking database, but now i would think object!
when i tell this i realize that im falling in love for this orm...ahahah!
then what is the correct way to do?
thanks,
Emanuele.

Offline

#2 2012-06-01 09:01:31

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: from trigger to delphi code

There is no automated way of implementing triggers at the ORM level, at high level.

In such occasion, I think you may go up one more level.
That is, not only from SQL to ORM, but from ORM to SOA.

Think as ORM as persistence layer: you map objects within the DB.
If you want your objects to be synchronized (e.g. change another TSQLRecord when one is modified), you should better create a service for the process.
Then within the method of this service, you write all the corresponding CRUD ORM operations in synch.

Offline

Board footer

Powered by FluxBB