diff options
author | Constantin Michael <constantin@codesynthesis.com> | 2011-11-15 16:35:47 +0200 |
---|---|---|
committer | Constantin Michael <constantin@codesynthesis.com> | 2011-11-16 11:25:33 +0200 |
commit | 076a61b6c19044a38de8c17b0fefbc74074491f4 (patch) | |
tree | 8e6e0e2ee69f4ccdc5757e866ddab1b39cbd4dcb /oracle/types/test.hxx | |
parent | 7b6ace8f265e12704cc1d7e0c6f26dfe51ea2809 (diff) |
Test containers of Oracle LOB types
Diffstat (limited to 'oracle/types/test.hxx')
-rw-r--r-- | oracle/types/test.hxx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/oracle/types/test.hxx b/oracle/types/test.hxx index be49b82..b496114 100644 --- a/oracle/types/test.hxx +++ b/oracle/types/test.hxx @@ -8,7 +8,7 @@ #include <string> #include <vector> -#include <iostream> +#include <memory> // std::auto_ptr #include <odb/core.hxx> @@ -96,6 +96,9 @@ struct time_interval int nanosecond; }; +typedef std::auto_ptr<std::string> string_ptr; +typedef std::vector<std::string> strings; + #pragma db object struct object { @@ -181,8 +184,15 @@ struct object #pragma db type ("NCLOB") std::string nclob_; + // Test containers of LOBs + // + #pragma db value_type ("CLOB") + strings strs_; + // Test NULL value. // + #pragma db type ("VARCHAR(32)") null + string_ptr null_; bool operator== (const object& y) const @@ -208,7 +218,9 @@ struct object raw_ == y.raw_ && blob_ == y.blob_ && clob_ == y.clob_ && - nclob_ == y.nclob_; + nclob_ == y.nclob_ && + strs_ == y.strs_ && + ((null_.get () == 0 && y.null_.get () == 0) || *null_ == *y.null_); } }; |