diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-10-27 15:54:35 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-01 13:14:55 +0200 |
commit | 25feb0393f8c8a1e9e0e0edf369b10b318a60599 (patch) | |
tree | 081bd6f7d87a83bbe5c6b9685cda268b127e5ac7 /odb/relational/oracle | |
parent | cf655b58f841f29adb214c710a47dcb0b32c5bc9 (diff) |
Implement query image change callback machinery
Diffstat (limited to 'odb/relational/oracle')
-rw-r--r-- | odb/relational/oracle/header.cxx | 13 | ||||
-rw-r--r-- | odb/relational/oracle/source.cxx | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/odb/relational/oracle/header.cxx b/odb/relational/oracle/header.cxx index 1e9e850..acbefef 100644 --- a/odb/relational/oracle/header.cxx +++ b/odb/relational/oracle/header.cxx @@ -16,6 +16,19 @@ namespace relational { namespace relational = relational::header; + struct image_type: relational::image_type, context + { + image_type (base const& x): base (x) {}; + + virtual void + image_extra (type& c) + { + if (options.generate_query () && !composite (c)) + os << "oracle::change_callback change_callback;"; + } + }; + entry<image_type> image_type_; + struct image_member: relational::image_member, member_base { image_member (base const& x) diff --git a/odb/relational/oracle/source.cxx b/odb/relational/oracle/source.cxx index a22c235..3383b6f 100644 --- a/odb/relational/oracle/source.cxx +++ b/odb/relational/oracle/source.cxx @@ -866,6 +866,14 @@ namespace relational } virtual void + init_image_pre (type& c) + { + if (options.generate_query () && !composite (c)) + os << "if (i.change_callback.callback != 0)" + << "(i.change_callback.callback) (i.change_callback.context);"; + } + + virtual void init_value_extra () { os << "sts.find_statement ().stream_result ();"; |