aboutsummaryrefslogtreecommitdiff
path: root/doc/manual.xhtml
diff options
context:
space:
mode:
Diffstat (limited to 'doc/manual.xhtml')
-rw-r--r--doc/manual.xhtml310
1 files changed, 223 insertions, 87 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index a87fa6a..06d7c82 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -596,27 +596,28 @@ for consistency.
<tr><th>14.4.12</th><td><a href="#14.4.12"><code>readonly</code></a></td></tr>
<tr><th>14.4.13</th><td><a href="#14.4.13"><code>virtual</code></a></td></tr>
<tr><th>14.4.14</th><td><a href="#14.4.14"><code>inverse</code></a></td></tr>
- <tr><th>14.4.15</th><td><a href="#14.4.15"><code>version</code></a></td></tr>
- <tr><th>14.4.16</th><td><a href="#14.4.16"><code>index</code></a></td></tr>
- <tr><th>14.4.17</th><td><a href="#14.4.17"><code>unique</code></a></td></tr>
- <tr><th>14.4.18</th><td><a href="#14.4.18"><code>unordered</code></a></td></tr>
- <tr><th>14.4.19</th><td><a href="#14.4.19"><code>table</code></a></td></tr>
- <tr><th>14.4.20</th><td><a href="#14.4.20"><code>load</code>/<code>update</code></a></td></tr>
- <tr><th>14.4.21</th><td><a href="#14.4.21"><code>section</code></a></td></tr>
- <tr><th>14.4.22</th><td><a href="#14.4.22"><code>added</code></a></td></tr>
- <tr><th>14.4.23</th><td><a href="#14.4.23"><code>deleted</code></a></td></tr>
- <tr><th>14.4.24</th><td><a href="#14.4.24"><code>index_type</code></a></td></tr>
- <tr><th>14.4.25</th><td><a href="#14.4.25"><code>key_type</code></a></td></tr>
- <tr><th>14.4.26</th><td><a href="#14.4.26"><code>value_type</code></a></td></tr>
- <tr><th>14.4.27</th><td><a href="#14.4.27"><code>value_null</code>/<code>value_not_null</code></a></td></tr>
- <tr><th>14.4.28</th><td><a href="#14.4.28"><code>id_options</code></a></td></tr>
- <tr><th>14.4.29</th><td><a href="#14.4.29"><code>index_options</code></a></td></tr>
- <tr><th>14.4.30</th><td><a href="#14.4.30"><code>key_options</code></a></td></tr>
- <tr><th>14.4.31</th><td><a href="#14.4.31"><code>value_options</code></a></td></tr>
- <tr><th>14.4.32</th><td><a href="#14.4.32"><code>id_column</code></a></td></tr>
- <tr><th>14.4.33</th><td><a href="#14.4.33"><code>index_column</code></a></td></tr>
- <tr><th>14.4.34</th><td><a href="#14.4.34"><code>key_column</code></a></td></tr>
- <tr><th>14.4.35</th><td><a href="#14.4.35"><code>value_column</code></a></td></tr>
+ <tr><th>14.4.15</th><td><a href="#14.4.15"><code>on_delete</code></a></td></tr>
+ <tr><th>14.4.16</th><td><a href="#14.4.16"><code>version</code></a></td></tr>
+ <tr><th>14.4.17</th><td><a href="#14.4.17"><code>index</code></a></td></tr>
+ <tr><th>14.4.18</th><td><a href="#14.4.18"><code>unique</code></a></td></tr>
+ <tr><th>14.4.19</th><td><a href="#14.4.19"><code>unordered</code></a></td></tr>
+ <tr><th>14.4.20</th><td><a href="#14.4.20"><code>table</code></a></td></tr>
+ <tr><th>14.4.21</th><td><a href="#14.4.21"><code>load</code>/<code>update</code></a></td></tr>
+ <tr><th>14.4.22</th><td><a href="#14.4.22"><code>section</code></a></td></tr>
+ <tr><th>14.4.23</th><td><a href="#14.4.23"><code>added</code></a></td></tr>
+ <tr><th>14.4.24</th><td><a href="#14.4.24"><code>deleted</code></a></td></tr>
+ <tr><th>14.4.25</th><td><a href="#14.4.25"><code>index_type</code></a></td></tr>
+ <tr><th>14.4.26</th><td><a href="#14.4.26"><code>key_type</code></a></td></tr>
+ <tr><th>14.4.27</th><td><a href="#14.4.27"><code>value_type</code></a></td></tr>
+ <tr><th>14.4.28</th><td><a href="#14.4.28"><code>value_null</code>/<code>value_not_null</code></a></td></tr>
+ <tr><th>14.4.29</th><td><a href="#14.4.29"><code>id_options</code></a></td></tr>
+ <tr><th>14.4.30</th><td><a href="#14.4.30"><code>index_options</code></a></td></tr>
+ <tr><th>14.4.31</th><td><a href="#14.4.31"><code>key_options</code></a></td></tr>
+ <tr><th>14.4.32</th><td><a href="#14.4.32"><code>value_options</code></a></td></tr>
+ <tr><th>14.4.33</th><td><a href="#14.4.33"><code>id_column</code></a></td></tr>
+ <tr><th>14.4.34</th><td><a href="#14.4.34"><code>index_column</code></a></td></tr>
+ <tr><th>14.4.35</th><td><a href="#14.4.35"><code>key_column</code></a></td></tr>
+ <tr><th>14.4.36</th><td><a href="#14.4.36"><code>value_column</code></a></td></tr>
</table>
</td>
</tr>
@@ -5783,7 +5784,7 @@ private:
of person's nicknames is probably not important. To instruct the ODB
compiler to ignore the order in ordered containers we can use the
<code>db&nbsp;unordered</code> pragma (<a href="#14.3.9">Section 14.3.9,
- "<code>unordered</code>"</a>, <a href="#14.4.18">Section 14.4.18,
+ "<code>unordered</code>"</a>, <a href="#14.4.19">Section 14.4.19,
"<code>unordered</code>"</a>). For example:</p>
<pre class="cxx">
@@ -6089,8 +6090,8 @@ for (;;)
<p><code>odb::vector</code> incurs 2-bit per element overhead
in order to store the change state. It cannot
- be stored unordered in the database (<a href="#14.4.18">Section
- 14.4.18 "<code>unordered</code>"</a>) but can be used as an inverse
+ be stored unordered in the database (<a href="#14.4.19">Section
+ 14.4.19 "<code>unordered</code>"</a>) but can be used as an inverse
side of a relationship (<a href="#6.2">6.2 "Bidirectional
Relationships"</a>). In this case, no change tracking is performed
since no state for such a container is stored in the database.</p>
@@ -6349,8 +6350,8 @@ class employee
use the <code>not_null</code> pragma (<a href="#14.4.6">Section
14.4.6, "<code>null</code>/<code>not_null</code>"</a>) for
single object pointers and the <code>value_not_null</code> pragma
- (<a href="#14.4.27">Section
- 14.4.27, "<code>value_null</code>/<code>value_not_null</code>"</a>)
+ (<a href="#14.4.28">Section
+ 14.4.28, "<code>value_null</code>/<code>value_not_null</code>"</a>)
for containers of object pointers. For example:</p>
<pre class="cxx">
@@ -6481,7 +6482,12 @@ result r (db.query&lt;employee> (query::employer.is_null ()));
or updated. Rather, only a reference to the object (in the form of the
object id) is stored for the pointed-to object in the database.
The pointed-to object itself is a separate entity and should
- be made persistent or updated independently.</p>
+ be made persistent or updated independently. By default, the
+ same principle also applies to erasing pointed-to objects. That
+ is, we have to make sure all the pointing objects are updated
+ accordingly. However, in the case of erase, we can specify an
+ alternative <code>on-delete</code> semantic as discussed in
+ <a href="#14.4.15">Section 14.4.15, "<code>on_delete</code>"</a>.</p>
<p>When persisting or updating an object containing a pointer to another
object, the pointed-to object must have a valid object id. This,
@@ -6808,7 +6814,7 @@ CREATE TABLE employee (
pointer. Also note that an ordered container (<a href="#5.1">Section
5.1, "Ordered Containers"</a>) of pointers that is an inverse side
of a bidirectional relationship is always treated as unordered
- (<a href="#14.4.18">Section 14.4.18, "<code>unordered</code>"</a>)
+ (<a href="#14.4.19">Section 14.4.19, "<code>unordered</code>"</a>)
because the contents of such a container are implicitly built from
the direct side of the relationship which does not contain the
element order (index).</p>
@@ -7895,9 +7901,9 @@ CREATE TABLE person (
<p>The same principle applies when a composite value type is used
as an element of a container, except that instead of
<code>db&nbsp;column</code>, either the <code>db&nbsp;value_column</code>
- (<a href="#14.4.35">Section 14.4.35, "<code>value_column</code>"</a>) or
+ (<a href="#14.4.36">Section 14.4.36, "<code>value_column</code>"</a>) or
<code>db&nbsp;key_column</code>
- (<a href="#14.4.34">Section 14.4.34, "<code>key_column</code>"</a>)
+ (<a href="#14.4.35">Section 14.4.35, "<code>key_column</code>"</a>)
pragmas are used to specify the column prefix.</p>
<p>When a composite value type contains a container, an extra table
@@ -7941,8 +7947,8 @@ CREATE TABLE person (
</pre>
<p>To customize the container table name we can use the
- <code>db&nbsp;table</code> pragma (<a href="#14.4.19">Section
- 14.4.19, "<code>table</code>"</a>), for example:</p>
+ <code>db&nbsp;table</code> pragma (<a href="#14.4.20">Section
+ 14.4.20, "<code>table</code>"</a>), for example:</p>
<pre class="cxx">
#pragma db value
@@ -11147,7 +11153,7 @@ p.age (age);
<p>To declare a persistent class with the optimistic concurrency model we
use the <code>optimistic</code> pragma (<a href="#14.1.5">Section 14.1.5,
"<code>optimistic</code>"</a>). We also use the <code>version</code>
- pragma (<a href="#14.4.15">Section 14.4.15, "<code>version</code>"</a>)
+ pragma (<a href="#14.4.16">Section 14.4.16, "<code>version</code>"</a>)
to specify which data member will store the object version. For
example:</p>
@@ -13826,7 +13832,7 @@ class person
has the optimistic concurrency model. A class with the optimistic
concurrency model must also specify the data member that is used to
store the object version using the <code>version</code> pragma
- (<a href="#14.4.15">Section 14.4.15, "<code>version</code>"</a>).
+ (<a href="#14.4.16">Section 14.4.16, "<code>version</code>"</a>).
For example:</p>
<pre class="cxx">
@@ -15004,7 +15010,7 @@ typedef std::vector&lt;std::string> nicknames;
<p>The semantics of the <code>id_options</code> specifier for a container
type are similar to those of the <code>id_options</code> specifier for
- a container data member (<a href="#14.4.28">Section 14.4.28,
+ a container data member (<a href="#14.4.29">Section 14.4.29,
"<code>id_options</code>"</a>).</p>
@@ -15021,7 +15027,7 @@ typedef std::vector&lt;std::string> nicknames;
<p>The semantics of the <code>index_options</code> specifier for a container
type are similar to those of the <code>index_options</code> specifier for
- a container data member (<a href="#14.4.29">Section 14.4.29,
+ a container data member (<a href="#14.4.30">Section 14.4.30,
"<code>index_options</code>"</a>).</p>
@@ -15038,7 +15044,7 @@ typedef std::map&lt;std::string, std::string> properties;
<p>The semantics of the <code>key_options</code> specifier for a container
type are similar to those of the <code>key_options</code> specifier for
- a container data member (<a href="#14.4.30">Section 14.4.30,
+ a container data member (<a href="#14.4.31">Section 14.4.31,
"<code>key_options</code>"</a>).</p>
@@ -15055,7 +15061,7 @@ typedef std::set&lt;std::string> nicknames;
<p>The semantics of the <code>value_options</code> specifier for a container
type are similar to those of the <code>value_options</code> specifier for
- a container data member (<a href="#14.4.31">Section 14.4.31,
+ a container data member (<a href="#14.4.32">Section 14.4.32,
"<code>value_options</code>"</a>).</p>
@@ -15218,129 +15224,135 @@ typedef std::map&lt;unsigned short, float> age_weight_map;
</tr>
<tr>
+ <td><code>on_delete</code></td>
+ <td><code>ON DELETE</code> clause for object pointer member</td>
+ <td><a href="#14.4.15">14.4.15</a></td>
+ </tr>
+
+ <tr>
<td><code>version</code></td>
<td>member stores object version</td>
- <td><a href="#14.4.15">14.4.15</a></td>
+ <td><a href="#14.4.16">14.4.16</a></td>
</tr>
<tr>
<td><code>index</code></td>
<td>define database index for a member</td>
- <td><a href="#14.4.16">14.4.16</a></td>
+ <td><a href="#14.4.17">14.4.17</a></td>
</tr>
<tr>
<td><code>unique</code></td>
<td>define unique database index for a member</td>
- <td><a href="#14.4.17">14.4.17</a></td>
+ <td><a href="#14.4.18">14.4.18</a></td>
</tr>
<tr>
<td><code>unordered</code></td>
<td>ordered container should be stored unordered</td>
- <td><a href="#14.4.18">14.4.18</a></td>
+ <td><a href="#14.4.19">14.4.19</a></td>
</tr>
<tr>
<td><code>table</code></td>
<td>table name for a container</td>
- <td><a href="#14.4.19">14.4.19</a></td>
+ <td><a href="#14.4.20">14.4.20</a></td>
</tr>
<tr>
<td><code>load</code>/<code>update</code></td>
<td>loading/updating behavior for a section</td>
- <td><a href="#14.4.20">14.4.20</a></td>
+ <td><a href="#14.4.21">14.4.21</a></td>
</tr>
<tr>
<td><code>section</code></td>
<td>member belongs to a section</td>
- <td><a href="#14.4.21">14.4.21</a></td>
+ <td><a href="#14.4.22">14.4.22</a></td>
</tr>
<tr>
<td><code>added</code></td>
<td>member is soft-added</td>
- <td><a href="#14.4.22">14.4.22</a></td>
+ <td><a href="#14.4.23">14.4.23</a></td>
</tr>
<tr>
<td><code>deleted</code></td>
<td>member is soft-deleted</td>
- <td><a href="#14.4.23">14.4.23</a></td>
+ <td><a href="#14.4.24">14.4.24</a></td>
</tr>
<tr>
<td><code>index_type</code></td>
<td>database type for a container's index type</td>
- <td><a href="#14.4.24">14.4.24</a></td>
+ <td><a href="#14.4.25">14.4.25</a></td>
</tr>
<tr>
<td><code>key_type</code></td>
<td>database type for a container's key type</td>
- <td><a href="#14.4.25">14.4.25</a></td>
+ <td><a href="#14.4.26">14.4.26</a></td>
</tr>
<tr>
<td><code>value_type</code></td>
<td>database type for a container's value type</td>
- <td><a href="#14.4.26">14.4.26</a></td>
+ <td><a href="#14.4.27">14.4.27</a></td>
</tr>
<tr>
<td><code>value_null</code>/<code>value_not_null</code></td>
<td>container's value can/cannot be <code>NULL</code></td>
- <td><a href="#14.4.27">14.4.27</a></td>
+ <td><a href="#14.4.28">14.4.28</a></td>
</tr>
<tr>
<td><code>id_options</code></td>
<td>database options for a container's id column</td>
- <td><a href="#14.4.28">14.4.28</a></td>
+ <td><a href="#14.4.29">14.4.29</a></td>
</tr>
<tr>
<td><code>index_options</code></td>
<td>database options for a container's index column</td>
- <td><a href="#14.4.29">14.4.29</a></td>
+ <td><a href="#14.4.30">14.4.30</a></td>
</tr>
<tr>
<td><code>key_options</code></td>
<td>database options for a container's key column</td>
- <td><a href="#14.4.30">14.4.30</a></td>
+ <td><a href="#14.4.31">14.4.31</a></td>
</tr>
<tr>
<td><code>value_options</code></td>
<td>database options for a container's value column</td>
- <td><a href="#14.4.31">14.4.31</a></td>
+ <td><a href="#14.4.32">14.4.32</a></td>
</tr>
<tr>
<td><code>id_column</code></td>
<td>column name for a container's object id</td>
- <td><a href="#14.4.32">14.4.32</a></td>
+ <td><a href="#14.4.33">14.4.33</a></td>
</tr>
<tr>
<td><code>index_column</code></td>
<td>column name for a container's index</td>
- <td><a href="#14.4.33">14.4.33</a></td>
+ <td><a href="#14.4.34">14.4.34</a></td>
</tr>
<tr>
<td><code>key_column</code></td>
<td>column name for a container's key</td>
- <td><a href="#14.4.34">14.4.34</a></td>
+ <td><a href="#14.4.35">14.4.35</a></td>
</tr>
<tr>
<td><code>value_column</code></td>
<td>column name for a container's value</td>
- <td><a href="#14.4.35">14.4.35</a></td>
+ <td><a href="#14.4.36">14.4.36</a></td>
</tr>
</table>
@@ -16341,12 +16353,136 @@ class person
relationship information. Only ordered and set containers can be used
for inverse members. If an inverse member is of an ordered container
type, it is automatically marked as unordered
- (<a href="#14.4.18">Section 14.4.18, "<code>unordered</code>"</a>).</p>
+ (<a href="#14.4.19">Section 14.4.19, "<code>unordered</code>"</a>).</p>
<p>For a more detailed discussion of inverse members, refer to
<a href="#6.2">Section 6.2, "Bidirectional Relationships"</a>.</p>
- <h3><a name="14.4.15">14.4.15 <code>version</code></a></h3>
+ <h3><a name="14.4.15">14.4.15 <code>on_delete</code></a></h3>
+
+ <p>The <code>on_delete</code> specifier specifies the on-delete semantics
+ for a data member of an object pointer or a container of object
+ pointers type. The single required argument to this specifier must
+ be either <code>cascade</code> or <code>set_null</code>.</p>
+
+ <p>The <code>on_delete</code> specifier is translated directly to the
+ corresponding <code>ON DELETE</code> SQL clause. That is, if
+ <code>cascade</code> is specified, then when a pointed-to object
+ is erased from the database, the database state of the pointing
+ object is automatically erased as well. If <code>set_null</code> is
+ specified, then when a pointed-to object is erased from the database,
+ the database state of the pointing object is automatically updated
+ to set the pointer column to <code>NULL</code>. For example:</p>
+
+ <pre class="cxx">
+#pragma db object
+class employer
+{
+ ...
+
+ #pragma db id auto
+ unsigned long id_;
+};
+
+#pragma db object
+class person
+{
+ ...
+
+ #pragma db on_delete(cascade)
+ employer* employer_;
+};
+
+unsigned long id;
+
+{
+ employer e;
+ person p;
+ p.employer_ = &amp;e;
+
+ transaction t (db.begin ());
+
+ id = db.persist (e);
+ db.persist (p);
+
+ t.commit ();
+}
+
+{
+ transaction t (db.begin ());
+
+ // Database state of the person object is erased as well.
+ //
+ db.erase&lt;employer> (id);
+
+ t.commit ();
+}
+ </pre>
+
+
+ <p>Note that this is a database-level functionality and care must be
+ taken in order not to end up with inconsistent object states in the
+ application's memory and database. The following example illustrates
+ the kind of problems one may encounter:</p>
+
+ <pre class="cxx">
+#pragma db object
+class employer
+{
+ ...
+};
+
+#pragma db object
+class person
+{
+ ...
+
+ #pragma db on_delete(set_null)
+ employer* employer_;
+};
+
+employer e;
+person p;
+p.employer_ = &amp;e;
+
+{
+ transaction t (db.begin ());
+ db.persist (e);
+ db.persist (p);
+ t.commit ();
+}
+
+{
+ transaction t (db.begin ());
+
+ // The employer column is set to NULL in the database but
+ // not the p.employer_ data member in the application.
+ //
+ db.erase (e);
+ t.commit ();
+}
+
+{
+ transaction t (db.begin ());
+
+ // Override the employer column with an invalid pointer.
+ //
+ db.update (p);
+
+ t.commit ();
+}
+ </pre>
+
+ <p>Note that even optimistic concurrency will not resolve such
+ issues unless you are using database-level support for optimistic
+ concurrency as well (for example, <code>ROWVERSION</code> in SQL
+ Server).</p>
+
+ <p>The <code>on_delete</code> specifier is only valid for non-inverse
+ object pointer data members. If the <code>set_null</code> semantics
+ is used, then the pointer must allow the <code>NULL</code> value.</p>
+
+ <h3><a name="14.4.16">14.4.16 <code>version</code></a></h3>
<p>The <code>version</code> specifier specifies that the data member stores
the object version used to support optimistic concurrency. If a class
@@ -16376,7 +16512,7 @@ class person
<p>For a more detailed discussion of optimistic concurrency, refer to
<a href="#12">Chapter 12, "Optimistic Concurrency"</a>.</p>
- <h3><a name="14.4.16">14.4.16 <code>index</code></a></h3>
+ <h3><a name="14.4.17">14.4.17 <code>index</code></a></h3>
<p>The <code>index</code> specifier instructs the ODB compiler to define
a database index for the data member. For example:</p>
@@ -16395,7 +16531,7 @@ class person
<p>For more information on defining database indexes, refer to
<a href="#14.7">Section 14.7, "Index Definition Pragmas"</a>.</p>
- <h3><a name="14.4.17">14.4.17 <code>unique</code></a></h3>
+ <h3><a name="14.4.18">14.4.18 <code>unique</code></a></h3>
<p>The <code>index</code> specifier instructs the ODB compiler to define
a unique database index for the data member. For example:</p>
@@ -16414,7 +16550,7 @@ class person
<p>For more information on defining database indexes, refer to
<a href="#14.7">Section 14.7, "Index Definition Pragmas"</a>.</p>
- <h3><a name="14.4.18">14.4.18 <code>unordered</code></a></h3>
+ <h3><a name="14.4.19">14.4.19 <code>unordered</code></a></h3>
<p>The <code>unordered</code> specifier specifies that the member of
an ordered container type should be stored unordered in the database.
@@ -16437,7 +16573,7 @@ class person
storage in the database, refer to <a href="#5.1">Section 5.1,
"Ordered Containers"</a>.</p>
- <h3><a name="14.4.19">14.4.19 <code>table</code></a></h3>
+ <h3><a name="14.4.20">14.4.20 <code>table</code></a></h3>
<p>The <code>table</code> specifier specifies the table name that should
be used to store the contents of the container member. For example:</p>
@@ -16485,7 +16621,7 @@ class person
qualified names, refer to <a href="#14.1.8">Section 14.1.8,
"<code>schema</code>"</a>.</p>
- <h3><a name="14.4.20">14.4.20 <code>load</code>/<code>update</code></a></h3>
+ <h3><a name="14.4.21">14.4.21 <code>load</code>/<code>update</code></a></h3>
<p>The <code>load</code> and <code>update</code> specifiers specify the
loading and updating behavior for an object section, respectively.
@@ -16495,7 +16631,7 @@ class person
<code>change</code>, and <code>manual</code>. For more information
on object sections, refer to <a href="#9">Chapter 9, "Sections"</a>.</p>
- <h3><a name="14.4.21">14.4.21 <code>section</code></a></h3>
+ <h3><a name="14.4.22">14.4.22 <code>section</code></a></h3>
<p>The <code>section</code> specifier indicates that a data member
of a persistent class belongs to an object section. The single
@@ -16504,7 +16640,7 @@ class person
members of a persistent class. For more information on object
sections, refer to <a href="#9">Chapter 9, "Sections"</a>.</p>
- <h3><a name="14.4.22">14.4.22 <code>added</code></a></h3>
+ <h3><a name="14.4.23">14.4.23 <code>added</code></a></h3>
<p>The <code>added</code> specifier marks the data member as
soft-added. The single required argument to this specifier is
@@ -16512,7 +16648,7 @@ class person
refer to <a href="#13.4">Section 13.4, "Soft Object Model
Changes"</a>.</p>
- <h3><a name="14.4.23">14.4.23 <code>deleted</code></a></h3>
+ <h3><a name="14.4.24">14.4.24 <code>deleted</code></a></h3>
<p>The <code>deleted</code> specifier marks the data member as
soft-deleted. The single required argument to this specifier is
@@ -16520,7 +16656,7 @@ class person
refer to <a href="#13.4">Section 13.4, "Soft Object Model
Changes"</a>.</p>
- <h3><a name="14.4.24">14.4.24 <code>index_type</code></a></h3>
+ <h3><a name="14.4.25">14.4.25 <code>index_type</code></a></h3>
<p>The <code>index_type</code> specifier specifies the native
database type that should be used for an ordered container's
@@ -16540,7 +16676,7 @@ class person
};
</pre>
- <h3><a name="14.4.25">14.4.25 <code>key_type</code></a></h3>
+ <h3><a name="14.4.26">14.4.26 <code>key_type</code></a></h3>
<p>The <code>key_type</code> specifier specifies the native
database type that should be used for a map container's
@@ -16560,7 +16696,7 @@ class person
};
</pre>
- <h3><a name="14.4.26">14.4.26 <code>value_type</code></a></h3>
+ <h3><a name="14.4.27">14.4.27 <code>value_type</code></a></h3>
<p>The <code>value_type</code> specifier specifies the native
database type that should be used for a container's
@@ -16581,12 +16717,12 @@ class person
</pre>
<p>The <code>value_null</code> and <code>value_not_null</code>
- (<a href="#14.4.27">Section 14.4.27,
+ (<a href="#14.4.28">Section 14.4.28,
"<code>value_null</code>/<code>value_not_null</code>"</a>) specifiers
can be used to control the <code>NULL</code> semantics of a value
column.</p>
- <h3><a name="14.4.27">14.4.27 <code>value_null</code>/<code>value_not_null</code></a></h3>
+ <h3><a name="14.4.28">14.4.28 <code>value_null</code>/<code>value_not_null</code></a></h3>
<p>The <code>value_null</code> and <code>value_not_null</code> specifiers
specify that a container's element value for the data member can or
@@ -16619,7 +16755,7 @@ class account
Multiset Containers"</a>) the element value is automatically treated
as not allowing a <code>NULL</code> value.</p>
- <h3><a name="14.4.28">14.4.28 <code>id_options</code></a></h3>
+ <h3><a name="14.4.29">14.4.29 <code>id_options</code></a></h3>
<p>The <code>id_options</code> specifier specifies additional
column definition options that should be used for a container's
@@ -16643,7 +16779,7 @@ class person
of the <code>options</code> specifier (<a href="#14.4.8">Section
14.4.8, "<code>options</code>"</a>).</p>
- <h3><a name="14.4.29">14.4.29 <code>index_options</code></a></h3>
+ <h3><a name="14.4.30">14.4.30 <code>index_options</code></a></h3>
<p>The <code>index_options</code> specifier specifies additional
column definition options that should be used for a container's
@@ -16664,7 +16800,7 @@ class person
of the <code>options</code> specifier (<a href="#14.4.8">Section
14.4.8, "<code>options</code>"</a>).</p>
- <h3><a name="14.4.30">14.4.30 <code>key_options</code></a></h3>
+ <h3><a name="14.4.31">14.4.31 <code>key_options</code></a></h3>
<p>The <code>key_options</code> specifier specifies additional
column definition options that should be used for a container's
@@ -16685,7 +16821,7 @@ class person
of the <code>options</code> specifier (<a href="#14.4.8">Section
14.4.8, "<code>options</code>"</a>).</p>
- <h3><a name="14.4.31">14.4.31 <code>value_options</code></a></h3>
+ <h3><a name="14.4.32">14.4.32 <code>value_options</code></a></h3>
<p>The <code>value_options</code> specifier specifies additional
column definition options that should be used for a container's
@@ -16706,7 +16842,7 @@ class person
of the <code>options</code> specifier (<a href="#14.4.8">Section
14.4.8, "<code>options</code>"</a>).</p>
- <h3><a name="14.4.32">14.4.32 <code>id_column</code></a></h3>
+ <h3><a name="14.4.33">14.4.33 <code>id_column</code></a></h3>
<p>The <code>id_column</code> specifier specifies the column
name that should be used to store the object id in a
@@ -16730,7 +16866,7 @@ class person
<p>If the column name is not specified, then <code>object_id</code>
is used by default.</p>
- <h3><a name="14.4.33">14.4.33 <code>index_column</code></a></h3>
+ <h3><a name="14.4.34">14.4.34 <code>index_column</code></a></h3>
<p>The <code>index_column</code> specifier specifies the column
name that should be used to store the element index in an
@@ -16754,7 +16890,7 @@ class person
<p>If the column name is not specified, then <code>index</code>
is used by default.</p>
- <h3><a name="14.4.34">14.4.34 <code>key_column</code></a></h3>
+ <h3><a name="14.4.35">14.4.35 <code>key_column</code></a></h3>
<p>The <code>key_column</code> specifier specifies the column
name that should be used to store the key in a map
@@ -16778,7 +16914,7 @@ class person
<p>If the column name is not specified, then <code>key</code>
is used by default.</p>
- <h3><a name="14.4.35">14.4.35 <code>value_column</code></a></h3>
+ <h3><a name="14.4.36">14.4.36 <code>value_column</code></a></h3>
<p>The <code>value_column</code> specifier specifies the column
name that should be used to store the element value in a
@@ -17138,9 +17274,9 @@ class object
<p>ODB also offers a shortcut for defining an index with the default
method and options for a single data member. Such an index can
- be defined using the <code>index</code> (<a href="#14.4.16">Section
- 14.4.16, "<code>index</code>"</a>) or <code>unique</code>
- (<a href="#14.4.17">Section 14.4.17, "<code>unique</code>"</a>)
+ be defined using the <code>index</code> (<a href="#14.4.17">Section
+ 14.4.17, "<code>index</code>"</a>) or <code>unique</code>
+ (<a href="#14.4.18">Section 14.4.18, "<code>unique</code>"</a>)
member specifier. For example:</p>
<pre class="cxx">
@@ -24524,8 +24660,8 @@ class Person
<p><code>QOdbList</code> incurs 2-bit per element overhead
in order to store the change state. It cannot
- be stored unordered in the database (<a href="#14.4.18">Section
- 14.4.18 "<code>unordered</code>"</a>) but can be used as an inverse
+ be stored unordered in the database (<a href="#14.4.19">Section
+ 14.4.19 "<code>unordered</code>"</a>) but can be used as an inverse
side of a relationship (<a href="#6.2">6.2 "Bidirectional
Relationships"</a>). In this case, no change tracking is performed
since no state for such a container is stored in the database.</p>