aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/query-dynamic.ixx
blob: d35865a3ec0d7b2e66bcfe359329b4be4ef280b0 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// file      : odb/oracle/query-dynamic.ixx
// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC
// license   : ODB NCUEL; see accompanying LICENSE file

namespace odb
{
  namespace oracle
  {
    //
    //
    template <typename T, database_type_id ID>
    inline query_column<T, ID>::
    query_column (odb::query_column<T>& qc,
                  const char* table,
                  const char* column,
                  const char* conv,
                  unsigned short prec,
                  short scale)
        : query_column_base (table, column, conv, prec, scale)
    {
      native_column_info& ci (qc.native_info[id_oracle]);
      ci.column = static_cast<query_column_base*> (this);

      // For some reason GCC needs this statically-typed pointer in
      // order to instantiate the functions.
      //
      query_param_factory f (&query_param_factory_impl<T, ID>);
      ci.param_factory = reinterpret_cast<void*> (f);
    }

    template <typename T>
    inline query_column<T, id_blob>::
    query_column (odb::query_column<T>& qc,
                  const char* table, const char* column, const char*)
        : lob_query_column (table, column)
    {
      native_column_info& ci (qc.native_info[id_oracle]);
      ci.column = static_cast<query_column_base*> (this);

      // In Oracle LOBs cannot be compared.
      //
      ci.param_factory = 0;
    }

    template <typename T>
    inline query_column<T, id_clob>::
    query_column (odb::query_column<T>& qc,
                  const char* table, const char* column, const char*)
        : lob_query_column (table, column)
    {
      native_column_info& ci (qc.native_info[id_oracle]);
      ci.column = static_cast<query_column_base*> (this);

      // In Oracle LOBs cannot be compared.
      //
      ci.param_factory = 0;
    }

    template <typename T>
    inline query_column<T, id_nclob>::
    query_column (odb::query_column<T>& qc,
                  const char* table, const char* column, const char*)
        : lob_query_column (table, column)
    {
      native_column_info& ci (qc.native_info[id_oracle]);
      ci.column = static_cast<query_column_base*> (this);

      // In Oracle LOBs cannot be compared.
      //
      ci.param_factory = 0;
    }
  }
}