aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-06-27 14:55:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-06-27 14:55:46 +0200
commit37a46b66c7805a5282cb868773f9d4211c1b11d0 (patch)
treef975f7215c19ceb60855c145efb1d77296508c38
parent6aef6b62bbb7c49e958ee4b160687fec1cb18ef7 (diff)
Add support for mapping posix_time::ptime and QDateTime to DATE Oracle type
-rw-r--r--NEWS4
-rw-r--r--doc/manual.xhtml36
2 files changed, 40 insertions, 0 deletions
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
<p>The Boost special value <code>date_time::not_a_date_time</code> is stored
as a <code>NULL</code> value in an Oracle database.</p>
+ <p>The <code>date-time</code> sub-profile implementation also provides
+ support for mapping <code>posix_time::ptime</code> to the
+ <code>DATE</code> Oracle type with fractional seconds that may be
+ stored in a <code>ptime</code> instance being ignored. This
+ alternative mapping has to be explicitly requested using the
+ <code>db&nbsp;type</code> pragma (<a href="#12.4.3">Section 12.4.3,
+ "<code>type</code>"</a>), as shown in the following example:</p>
+
+ <pre class="cxx">
+#pragma db object
+class person
+{
+ ...
+ #pragma db type("DATE")
+ boost::posix_time::ptime updated_;
+};
+ </pre>
+
<p>Some valid Boost date-time values cannot be stored in an Oracle database.
An attempt to persist a <code>gregorian::date</code>,
<code>posix_time::ptime</code>, or
@@ -16836,6 +16854,24 @@ class Person
<code>QDateTime</code> types are stored as a NULL value if their
<code>isNull()</code> member function returns true.</p>
+ <p>The <code>date-time</code> sub-profile implementation also provides
+ support for mapping <code>QDateTime</code> to the
+ <code>DATE</code> Oracle type with fractional seconds that may be
+ stored in a <code>QDateTime</code> instance being ignored. This
+ alternative mapping has to be explicitly requested using the
+ <code>db&nbsp;type</code> pragma (<a href="#12.4.3">Section 12.4.3,
+ "<code>type</code>"</a>), as shown in the following example:</p>
+
+ <pre class="cxx">
+#pragma db object
+class person
+{
+ ...
+ #pragma db type("DATE")
+ QDateTime updated_;
+};
+ </pre>
+
<h3><a name="20.4.5">20.4.5 SQL Server Database Type Mapping</a></h3>
<p>The following table summarizes the default mapping between the currently