aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-07 10:13:24 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:44 +0200
commit2fa6a4d00945866e62d980270d5807f3abca75ab (patch)
treef8eaf6760c2b18ff39962f4145df57b6fe5d9afa /odb/relational/source.hxx
parentbb111ac2fdff909ed0f91d6f1f65c05aaf984936 (diff)
Don't throw null_pointer on load operations
This can be useful during migration. Plus this should be enforced by the database.
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index 0b50788..22f78a7 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -1653,10 +1653,11 @@ namespace relational
os << ")" << endl;
- if (!null (mi.m, key_prefix_) )
- os << "throw null_pointer ();";
- else
- os << member << " = ptr_traits::pointer_type ();";
+ // Don't throw null_pointer if we can't have NULLs and the pointer
+ // is NULL since this can be useful during migration. Instead, we
+ // rely on the database enforcing this.
+ //
+ os << member << " = ptr_traits::pointer_type ();";
os << "else"
<< "{";