aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/source.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-04 11:22:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-04 11:22:07 +0200
commitc1877f84f3596f67245abe6658b08c050bd1e686 (patch)
tree57ae8ba5818a752abc763b1510b296a4a46d1ad4 /odb/relational/source.hxx
parente288ee241317773c77d954c8c286f53a963e7c19 (diff)
NULL handling improvements
Add support for specifying NULL-ness for types with built-in mapping. Handle Oracle [N]VARCHAR2 and SQLite FLOAT oddities using this mechanism instead of overriding it at the schema generation level. Also use the is_null argument that is passed to value_traits::init_image() to indicate whether the value can be NULL.
Diffstat (limited to 'odb/relational/source.hxx')
-rw-r--r--odb/relational/source.hxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx
index 3ad463b..21954e0 100644
--- a/odb/relational/source.hxx
+++ b/odb/relational/source.hxx
@@ -1298,7 +1298,11 @@ namespace relational
else
{
type = mi.fq_type ();
- os << "bool is_null;";
+
+ // Indicate to the value_traits whether this column can be NULL.
+ //
+ os << "bool is_null (" <<
+ (null (mi.m, key_prefix_) ? "true" : "false") << ");";
}
if (comp)