From 37a46b66c7805a5282cb868773f9d4211c1b11d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 27 Jun 2012 14:55:46 +0200 Subject: Add support for mapping posix_time::ptime and QDateTime to DATE Oracle type --- NEWS | 4 ++++ doc/manual.xhtml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/NEWS b/NEWS index 9a41e2f..3110918 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,10 @@ Version 2.1.0 thread. For more information, refer to Chapter 10, "Session" in the ODB manual. + * Support for mapping boost::posix_time::ptime and QDateTime to the DATE + Oracle type. For more information, refer to Sections 19.4.4 (Boost) and + 20.4.4 (Qt) in the ODB manual. + Version 2.0.0 * Support for C++11. The newly supported C++11 standard library components diff --git a/doc/manual.xhtml b/doc/manual.xhtml index 73b4e61..095f540 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -16114,6 +16114,24 @@ class person

The Boost special value date_time::not_a_date_time is stored as a NULL value in an Oracle database.

+

The date-time sub-profile implementation also provides + support for mapping posix_time::ptime to the + DATE Oracle type with fractional seconds that may be + stored in a ptime instance being ignored. This + alternative mapping has to be explicitly requested using the + db type pragma (Section 12.4.3, + "type"), as shown in the following example:

+ +
+#pragma db object
+class person
+{
+  ...
+  #pragma db type("DATE")
+  boost::posix_time::ptime updated_;
+};
+  
+

Some valid Boost date-time values cannot be stored in an Oracle database. An attempt to persist a gregorian::date, posix_time::ptime, or @@ -16836,6 +16854,24 @@ class Person QDateTime types are stored as a NULL value if their isNull() member function returns true.

+

The date-time sub-profile implementation also provides + support for mapping QDateTime to the + DATE Oracle type with fractional seconds that may be + stored in a QDateTime instance being ignored. This + alternative mapping has to be explicitly requested using the + db type pragma (Section 12.4.3, + "type"), as shown in the following example:

+ +
+#pragma db object
+class person
+{
+  ...
+  #pragma db type("DATE")
+  QDateTime updated_;
+};
+  
+

20.4.5 SQL Server Database Type Mapping

The following table summarizes the default mapping between the currently -- cgit v1.1