diff options
Diffstat (limited to 'odb/type-processor.cxx')
-rw-r--r-- | odb/type-processor.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/odb/type-processor.cxx b/odb/type-processor.cxx index b47c413..381a4e4 100644 --- a/odb/type-processor.cxx +++ b/odb/type-processor.cxx @@ -107,8 +107,12 @@ namespace if (type.empty () && idt.count ("type")) type = idt.get<string> ("type"); - type = data_->column_type_impl ( - idt, type, id, ctf_default_null | ctf_object_id_ref); + column_type_flags f (ctf_object_id_ref); + + if (null_pointer (m)) + f |= ctf_default_null; + + type = data_->column_type_impl (idt, type, id, f); } else { @@ -190,8 +194,12 @@ namespace if (type.empty () && idt.count ("type")) type = idt.get<string> ("type"); - type = data_->column_type_impl ( - idt, type, id, ctf_default_null | ctf_object_id_ref); + column_type_flags f (ctf_object_id_ref); + + if (null_pointer (m, prefix)) + f |= ctf_default_null; + + type = data_->column_type_impl (idt, type, id, f); } else type = data_->column_type_impl (t, type, m, ctf_none); @@ -465,6 +473,12 @@ namespace m.set (kp + (kp.empty () ? "": "-") + "object-pointer", c); + if (m.count ("not-null") && !kp.empty ()) + { + m.remove ("not-null"); + m.set (kp + "-not-null", string ()); // Keep compatible with pragma. + } + // See if this is the inverse side of a bidirectional relationship. // If so, then resolve the member and cache it in the context. // |