aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oracle/types/driver.cxx5
-rw-r--r--oracle/types/test.hxx16
-rw-r--r--qt/oracle/basic/driver.cxx1
3 files changed, 20 insertions, 2 deletions
diff --git a/oracle/types/driver.cxx b/oracle/types/driver.cxx
index aac636a..fa056ff 100644
--- a/oracle/types/driver.cxx
+++ b/oracle/types/driver.cxx
@@ -65,6 +65,11 @@ main (int argc, char* argv[])
o.raw_.assign (long_str.data (), long_str.data () + long_str.size ());
o.blob_.assign (vlong_str.data (), vlong_str.data () + vlong_str.size ());
+ o.strs_.push_back (short_str);
+ o.strs_.push_back (medium_str);
+ o.strs_.push_back (long_str);
+ o.strs_.push_back (vlong_str);
+
// Persist.
//
{
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_);
}
};
diff --git a/qt/oracle/basic/driver.cxx b/qt/oracle/basic/driver.cxx
index 39f6b41..1afb966 100644
--- a/qt/oracle/basic/driver.cxx
+++ b/qt/oracle/basic/driver.cxx
@@ -32,6 +32,7 @@ main (int argc, char* argv[])
string long_str (20000, 'l');
object o;
+
o.varchar = "John Doe";
o.clob = QString::fromStdString (string (150, 'c'));
o.nclob = QString::fromStdString (long_str);