diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-04 17:53:47 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-07-04 17:53:47 +0200 |
commit | 3c549ec489afe54037bd2d486502f10971a75cb5 (patch) | |
tree | 5c0428f3383a605d0d31b6d28680c2c9c02a90b9 /odb/mysql/result.txx | |
parent | 47584aa7e59d5bd273970551a26c4b8f8c1cba3d (diff) |
Implement support for database operations callbacks
New object pragma: callback. New test: common/callback. New manual
section: 10.1.4, "callback".
Diffstat (limited to 'odb/mysql/result.txx')
-rw-r--r-- | odb/mysql/result.txx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/odb/mysql/result.txx b/odb/mysql/result.txx index f6d0a79..84eb723 100644 --- a/odb/mysql/result.txx +++ b/odb/mysql/result.txx @@ -3,6 +3,7 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +#include <odb/callback.hxx> #include <odb/exceptions.hxx> namespace odb @@ -39,8 +40,11 @@ namespace odb assert (!statements_.locked ()); typename object_statements<object_type>::auto_lock l (statements_); + odb::database& db (this->database ()); + object_traits::callback (db, obj, callback_event::pre_load); + typename object_traits::image_type& i (statements_.image ()); - object_traits::init (obj, i, this->database ()); + object_traits::init (obj, i, db); // Initialize the id image and binding and load the rest of the object // (containers, etc). @@ -57,8 +61,9 @@ namespace odb } object_traits::load_ (statements_, obj); - statements_.load_delayed (); + object_traits::callback (db, obj, callback_event::post_load); + l.unlock (); } |