summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/relational/oracle/header.cxx22
-rw-r--r--odb/relational/oracle/source.cxx4
2 files changed, 22 insertions, 4 deletions
diff --git a/odb/relational/oracle/header.cxx b/odb/relational/oracle/header.cxx
index cb9dd8a..b93981c 100644
--- a/odb/relational/oracle/header.cxx
+++ b/odb/relational/oracle/header.cxx
@@ -23,8 +23,26 @@ namespace relational
virtual void
image_extra (type& c)
{
- if (options.generate_query () && !(composite (c) || abstract (c)))
- os << "oracle::change_callback change_callback;";
+ if (!(composite (c) || abstract (c)))
+ {
+ bool f (options.generate_query ());
+
+ if (f)
+ os << "oracle::change_callback change_callback_;"
+ << endl;
+
+ os << "oracle::change_callback*" << endl
+ << "change_callback ()"
+ << "{";
+
+ if (f)
+ os << "return &change_callback_;";
+ else
+ os << "return 0;";
+
+ os << "}"
+ << endl;
+ }
}
};
entry<image_type> image_type_;
diff --git a/odb/relational/oracle/source.cxx b/odb/relational/oracle/source.cxx
index 1876c81..62b417b 100644
--- a/odb/relational/oracle/source.cxx
+++ b/odb/relational/oracle/source.cxx
@@ -869,8 +869,8 @@ namespace relational
init_image_pre (type& c)
{
if (options.generate_query () && !(composite (c) || abstract (c)))
- os << "if (i.change_callback.callback != 0)"
- << "(i.change_callback.callback) (i.change_callback.context);"
+ os << "if (i.change_callback_.callback != 0)"
+ << "(i.change_callback_.callback) (i.change_callback_.context);"
<< endl;
}