diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2013-05-06 12:05:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2013-08-14 15:19:49 +0200 |
commit | 09d7377f81aeb8fde4aa1698e946457f03380d45 (patch) | |
tree | eaedf7045fde8354a3693ce77edc7d5f86824e4e /odb/relational/mssql/header.cxx | |
parent | 548f0b10aa3adfc722198bf31f773ba85047f344 (diff) |
Add support for object sections
Sections are an optimization mechanism that allows the partitioning of
data members of a persistent class into groups that can be separately
loaded and/or updated.
Diffstat (limited to 'odb/relational/mssql/header.cxx')
-rw-r--r-- | odb/relational/mssql/header.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/odb/relational/mssql/header.cxx b/odb/relational/mssql/header.cxx index 1b868fc..5601755 100644 --- a/odb/relational/mssql/header.cxx +++ b/odb/relational/mssql/header.cxx @@ -47,6 +47,32 @@ namespace relational }; entry<class1> class1_entry_; + struct section_traits: relational::section_traits, context + { + section_traits (base const& x): base (x) {} + + virtual void + section_public_extra_pre (user_section&) + { + if (abstract (c_) && !polymorphic (c_)) + return; + + // rowvesion + // + bool rv (false); + if (semantics::data_member* m = optimistic (c_)) + { + sql_type t (parse_sql_type (column_type (*m), *m)); + rv = (t.type == sql_type::ROWVERSION); + } + + os << "static const bool rowversion = " << + (rv ? "true" : "false") << ";" + << endl; + } + }; + entry<section_traits> section_traits_; + struct image_type: relational::image_type, context { image_type (base const& x): base (x) {}; |