From 55b36b8297ef9aac9e4ccc7b98f8649534ee0ac1 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Aug 2014 09:37:06 +0200 Subject: Implement bulk database operation support for Oracle and SQL Server --- odb/relational/mssql/header.cxx | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'odb/relational/mssql/header.cxx') 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 ("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_entry_; -- cgit v1.1