aboutsummaryrefslogtreecommitdiff
path: root/odb/oracle/query.hxx
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:17:53 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-27 12:17:53 +0200
commitef1a2f93bec26617fb2c9287bd42c9179f76165c (patch)
treeb20ecebd60e7bdce54f43b6be4cf1d2d2a07a429 /odb/oracle/query.hxx
parent796f2ab6ae9e37359f6b357a36dba1f8d925b22e (diff)
Refactor query_column implementations for LOB columns
Diffstat (limited to 'odb/oracle/query.hxx')
-rw-r--r--odb/oracle/query.hxx88
1 files changed, 11 insertions, 77 deletions
diff --git a/odb/oracle/query.hxx b/odb/oracle/query.hxx
index d491cdf..ac5cfc6 100644
--- a/odb/oracle/query.hxx
+++ b/odb/oracle/query.hxx
@@ -1057,12 +1057,11 @@ namespace odb
// predicates for these types.
//
- template <typename T>
- struct query_column<T, id_blob>
+ struct LIBODB_ORACLE_EXPORT lob_query_column
{
// Note that we keep shalow copies of the table and column names.
//
- query_column (const char* table, const char* column)
+ lob_query_column (const char* table, const char* column)
: table_ (table), column_ (column)
{
}
@@ -1104,95 +1103,30 @@ namespace odb
};
template <typename T>
- struct query_column<T, id_clob>
+ struct query_column<T, id_blob>: lob_query_column
{
- // Note that we keep shalow copies of the table and column names.
- //
query_column (const char* table, const char* column)
- : table_ (table), column_ (column)
+ : lob_query_column (table, column)
{
}
+ };
- const char*
- table () const
- {
- return table_;
- }
-
- const char*
- column () const
- {
- return column_;
- }
-
- // is_null, is_not_null
- //
- public:
- query
- is_null () const
- {
- query q (table_, column_);
- q += "IS NULL";
- return q;
- }
-
- query
- is_not_null () const
+ template <typename T>
+ struct query_column<T, id_clob>
+ {
+ query_column (const char* table, const char* column)
+ : lob_query_column (table, column)
{
- query q (table_, column_);
- q += "IS NOT NULL";
- return q;
}
-
- private:
- const char* table_;
- const char* column_;
};
template <typename T>
struct query_column<T, id_nclob>
{
- // Note that we keep shalow copies of the table and column names.
- //
query_column (const char* table, const char* column)
- : table_ (table), column_ (column)
- {
- }
-
- const char*
- table () const
- {
- return table_;
- }
-
- const char*
- column () const
- {
- return column_;
- }
-
- // is_null, is_not_null
- //
- public:
- query
- is_null () const
- {
- query q (table_, column_);
- q += "IS NULL";
- return q;
- }
-
- query
- is_not_null () const
+ : lob_query_column (table, column)
{
- query q (table_, column_);
- q += "IS NOT NULL";
- return q;
}
-
- private:
- const char* table_;
- const char* column_;
};
// Provide operator+() for using columns to construct native