aboutsummaryrefslogtreecommitdiff
path: root/boost/oracle/date-time
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-27 14:55:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-27 14:55:47 +0200
commit5e98aad4b067ece803b75cae7f538565da8661c8 (patch)
tree92bdf22c225e22622dd26c5903da4859155c418e /boost/oracle/date-time
parent40e8a72ebd1a8bb475b3bb25f23d8c205dadeb06 (diff)
Add support for mapping posix_time::ptime and QDateTime to DATE Oracle type
Diffstat (limited to 'boost/oracle/date-time')
-rw-r--r--boost/oracle/date-time/driver.cxx4
-rw-r--r--boost/oracle/date-time/test.hxx3
2 files changed, 7 insertions, 0 deletions
diff --git a/boost/oracle/date-time/driver.cxx b/boost/oracle/date-time/driver.cxx
index ca59757..a1a12fb 100644
--- a/boost/oracle/date-time/driver.cxx
+++ b/boost/oracle/date-time/driver.cxx
@@ -53,6 +53,10 @@ main (int argc, char* argv[])
o.times.push_back (min_date_time);
o.times.push_back (ptime (max_date_time));
+ o.times_d.push_back (ptime (date (2012, 6, 27),
+ time_duration (14, 17, 05, 0)));
+ o.times_d.push_back (not_a_date_time);
+
o.durations.push_back (time_duration (1, 2, 3, 123456));
o.durations.push_back (time_duration (-1, 2, 3));
o.durations.push_back (not_a_date_time);
diff --git a/boost/oracle/date-time/test.hxx b/boost/oracle/date-time/test.hxx
index 9699c5d..e7afe8f 100644
--- a/boost/oracle/date-time/test.hxx
+++ b/boost/oracle/date-time/test.hxx
@@ -26,6 +26,7 @@ struct object
id == x.id &&
dates == x.dates &&
times == x.times &&
+ times_d == x.times_d &&
durations == x.durations;
}
@@ -34,6 +35,8 @@ struct object
std::vector<boost::gregorian::date> dates;
std::vector<boost::posix_time::ptime> times;
+ #pragma db value_type("DATE")
+ std::vector<boost::posix_time::ptime> times_d;
std::vector<boost::posix_time::time_duration> durations;
};