aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/pgsql
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-04-27 11:36:43 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-04-27 11:36:43 +0200
commit15b1a95942518c84f8161c59820ea5d0e49a4e54 (patch)
tree0a2f6e60622c6085dba00d21e094944526f97d33 /odb/relational/pgsql
parent7e22a444bc360d1b74a25c6d508daea86ca8d5d2 (diff)
Add support for NULL pointers to objects with composite object ids
Diffstat (limited to 'odb/relational/pgsql')
-rw-r--r--odb/relational/pgsql/inline.cxx43
1 files changed, 43 insertions, 0 deletions
diff --git a/odb/relational/pgsql/inline.cxx b/odb/relational/pgsql/inline.cxx
new file mode 100644
index 0000000..ece021a
--- /dev/null
+++ b/odb/relational/pgsql/inline.cxx
@@ -0,0 +1,43 @@
+// file : odb/relational/pgsql/inline.cxx
+// copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
+// license : GNU GPL v3; see accompanying LICENSE file
+
+#include <odb/relational/inline.hxx>
+
+#include <odb/relational/pgsql/common.hxx>
+#include <odb/relational/pgsql/context.hxx>
+
+using namespace std;
+
+namespace relational
+{
+ namespace pgsql
+ {
+ namespace inline_
+ {
+ namespace relational = relational::inline_;
+
+ struct null_member: relational::null_member_impl<sql_type>,
+ member_base
+ {
+ null_member (base const& x)
+ : member_base::base (x), // virtual base
+ member_base::base_impl (x), // virtual base
+ base_impl (x),
+ member_base (x)
+ {
+ }
+
+ virtual void
+ traverse_simple (member_info& mi)
+ {
+ if (get_)
+ os << "r = r && i." << mi.var << "null;";
+ else
+ os << "i." << mi.var << "null = true;";
+ }
+ };
+ entry<null_member> null_member_;
+ }
+ }
+}