From 4eceea6c547240df49697f9d22ccaf4e9101b915 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 4 Jul 2011 17:53:47 +0200 Subject: Implement support for database operations callbacks New object pragma: callback. New test: common/callback. New manual section: 10.1.4, "callback". --- odb/sqlite/result.txx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'odb/sqlite/result.txx') diff --git a/odb/sqlite/result.txx b/odb/sqlite/result.txx index daf4d39..728411d 100644 --- a/odb/sqlite/result.txx +++ b/odb/sqlite/result.txx @@ -3,6 +3,7 @@ // copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC // license : GNU GPL v2; see accompanying LICENSE file +#include #include namespace odb @@ -37,8 +38,11 @@ namespace odb assert (!statements_.locked ()); typename object_statements::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). @@ -55,8 +59,9 @@ namespace odb } object_traits::load_ (statements_, obj); - statements_.load_delayed (); + object_traits::callback (db, obj, callback_event::post_load); + l.unlock (); } -- cgit v1.1