summaryrefslogtreecommitdiff
path: root/odb/relational/mssql/header.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-08-14 09:37:06 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-11-25 06:47:21 +0200
commit55b36b8297ef9aac9e4ccc7b98f8649534ee0ac1 (patch)
treee9f0d22285d7fc9ad814b75eac9d587c6d630995 /odb/relational/mssql/header.cxx
parent19ba3497c0788f02fc417f441d87c96ce23f9446 (diff)
Implement bulk database operation support for Oracle and SQL Server
Diffstat (limited to 'odb/relational/mssql/header.cxx')
-rw-r--r--odb/relational/mssql/header.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/odb/relational/mssql/header.cxx b/odb/relational/mssql/header.cxx
index f943a8a..3bc2cbd 100644
--- a/odb/relational/mssql/header.cxx
+++ b/odb/relational/mssql/header.cxx
@@ -31,6 +31,17 @@ namespace relational
if (poly_derived || (abst && !poly))
return;
+ // Bulk operations batch size.
+ //
+ {
+ unsigned long long b (c.count ("bulk")
+ ? c.get<unsigned long long> ("bulk")
+ : 1);
+
+ os << "static const std::size_t batch = " << b << "UL;"
+ << endl;
+ }
+
// rowvesion
//
bool rv (false);
@@ -43,6 +54,30 @@ namespace relational
os << "static const bool rowversion = " << rv << ";"
<< endl;
}
+
+ virtual void
+ object_public_extra_post (type& c)
+ {
+ bool abst (abstract (c));
+
+ type* poly_root (polymorphic (c));
+ bool poly (poly_root != 0);
+ bool poly_derived (poly && poly_root != &c);
+
+ if (poly_derived || (abst && !poly))
+ return;
+
+ if (semantics::data_member* m = optimistic (c))
+ {
+ sql_type t (parse_sql_type (column_type (*m), *m));
+ if (t.type == sql_type::ROWVERSION)
+ {
+ os << "static version_type" << endl
+ << "version (const id_image_type&);"
+ << endl;
+ }
+ }
+ }
};
entry<class1> class1_entry_;