From ef1a2f93bec26617fb2c9287bd42c9179f76165c Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Thu, 27 Oct 2011 12:17:53 +0200 Subject: Refactor query_column implementations for LOB columns --- odb/oracle/query.hxx | 88 +++++++--------------------------------------------- 1 file 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 - struct query_column + 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 - struct query_column + struct query_column: 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 + struct query_column + { + 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 struct 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) - { - } - - 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 -- cgit v1.1