From 2fa6a4d00945866e62d980270d5807f3abca75ab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 7 Apr 2013 10:13:24 +0200 Subject: Don't throw null_pointer on load operations This can be useful during migration. Plus this should be enforced by the database. --- odb/relational/source.hxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'odb/relational/source.hxx') 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" << "{"; -- cgit v1.1