summaryrefslogtreecommitdiff
path: root/odb/relational/oracle/header.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/oracle/header.cxx')
-rw-r--r--odb/relational/oracle/header.cxx33
1 files changed, 20 insertions, 13 deletions
diff --git a/odb/relational/oracle/header.cxx b/odb/relational/oracle/header.cxx
index 91f1d93..3eca2e2 100644
--- a/odb/relational/oracle/header.cxx
+++ b/odb/relational/oracle/header.cxx
@@ -22,24 +22,31 @@ namespace relational
virtual void
image_extra (type& c)
{
- if (!(composite (c) || abstract (c)))
+ if (!(composite (c) || (abstract (c) && !polymorphic (c))))
{
- bool gc (options.generate_query ());
+ type* poly_root (polymorphic (c));
- if (gc)
- os << "oracle::change_callback change_callback_;"
- << endl;
+ // If this is a polymorphic type, only add callback to the root.
+ //
+ if (poly_root == 0 || poly_root == &c)
+ {
+ bool gc (options.generate_query ());
- os << "oracle::change_callback*" << endl
- << "change_callback ()"
- << "{";
+ if (gc)
+ os << "oracle::change_callback change_callback_;"
+ << endl;
- if (gc)
- os << "return &change_callback_;";
- else
- os << "return 0;";
+ os << "oracle::change_callback*" << endl
+ << "change_callback ()"
+ << "{";
- os << "}";
+ if (gc)
+ os << "return &change_callback_;";
+ else
+ os << "return 0;";
+
+ os << "}";
+ }
}
}
};