aboutsummaryrefslogtreecommitdiff
path: root/odb/mssql/no-id-object-statements.txx
blob: a8920660a9de79c2d2766ed3cf60e9313d58d71d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// file      : odb/mssql/no-id-object-statements.txx
// copyright : Copyright (c) 2005-2018 Code Synthesis Tools CC
// license   : ODB NCUEL; see accompanying LICENSE file

#include <cstring> // std::memset

namespace odb
{
  namespace mssql
  {
    template <typename T>
    no_id_object_statements<T>::
    ~no_id_object_statements ()
    {
    }

    template <typename T>
    no_id_object_statements<T>::
    no_id_object_statements (connection_type& conn)
        : statements_base (conn),
          select_image_binding_ (select_image_bind_, select_column_count),
          insert_image_binding_ (insert_image_bind_,
                                 insert_column_count,
                                 object_traits::batch,
                                 sizeof (image_type),
                                 status_)
    {
      image_[0].version = 0; // Only version in the first element used.
      select_image_version_ = 0;
      insert_image_version_ = 0;

      // SELECT statements only use the first element (no batches).
      //
      select_image_binding_.change_callback = image_[0].change_callback ();

      std::memset (insert_image_bind_, 0, sizeof (insert_image_bind_));
      std::memset (select_image_bind_, 0, sizeof (select_image_bind_));
    }
  }
}