Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #5991 > unrolled thread
| Started by | Victor Porton <porton@narod.ru> |
|---|---|
| First post | 2015-11-27 19:41 +0200 |
| Last post | 2015-11-27 19:41 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.programming
Should onInsert call onUpdate? Victor Porton <porton@narod.ru> - 2015-11-27 19:41 +0200
| From | Victor Porton <porton@narod.ru> |
|---|---|
| Date | 2015-11-27 19:41 +0200 |
| Subject | Should onInsert call onUpdate? |
| Message-ID | <n3a4l3$fp7$1@speranza.aioe.org> |
I am writing a lightweight ORM for SQL.
I create virtual methods onBeforeInsert, onBeforeUpdate and onAfterInsert,
onAfterUpdate which are called respectively before or after INSERT or UPDATE
SQL statements (done by my ORM when I ask it to save an object to the DB).
Should on{Before,After}Update also be called for INSERT queries?
My logical construction is the following: INSERT can be logically equivalent
to creating a "default" object and then UPDATE it.
Accordingly this thought, when inserting all four virtual method should be
called.
What do you think on this?
--
Victor Porton - http://portonvictor.org
Back to top | Article view | comp.programming
csiph-web