summaryrefslogtreecommitdiff
path: root/odb/relational/model.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-26 13:16:57 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-26 13:16:57 +0200
commit5125cad0209640b61007b921637c78504a4924d2 (patch)
tree983683a62ba00d68e51132c261a796f1bdfb811b /odb/relational/model.hxx
parentf85d634ac895a6ad937d8bc0861cc483d07da1cb (diff)
Add --sqlite-override-null option
Diffstat (limited to 'odb/relational/model.hxx')
-rw-r--r--odb/relational/model.hxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/odb/relational/model.hxx b/odb/relational/model.hxx
index c50b6b5..5936ed1 100644
--- a/odb/relational/model.hxx
+++ b/odb/relational/model.hxx
@@ -102,20 +102,18 @@ namespace relational
virtual bool
traverse_column (semantics::data_member& m, string const& name, bool)
{
- bool id (object_columns_base::id ()); // Id or part of.
- bool null (!id && object_columns_base::null ());
-
string col_id (id_prefix_ +
(key_prefix_.empty () ? m.name () : key_prefix_));
sema_rel::column& c (
- model_.new_node<sema_rel::column> (col_id, column_type (), null));
+ model_.new_node<sema_rel::column> (
+ col_id, column_type (), null (m)));
c.set ("cxx-location", m.location ());
model_.new_edge<sema_rel::unames> (table_, c, name);
// An id member cannot have a default value.
//
- if (!id)
+ if (!object_columns_base::id ())
{
string const& d (default_ (m));
@@ -134,6 +132,12 @@ namespace relational
return true;
}
+ virtual bool
+ null (semantics::data_member&)
+ {
+ return !object_columns_base::id () && object_columns_base::null ();
+ }
+
virtual string
default_null (semantics::data_member&)
{