diff options
Diffstat (limited to 'doc/manual.xhtml')
-rw-r--r-- | doc/manual.xhtml | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/doc/manual.xhtml b/doc/manual.xhtml index 395c90e..ffc485c 100644 --- a/doc/manual.xhtml +++ b/doc/manual.xhtml @@ -1207,16 +1207,17 @@ private: unnecessary.</p> <p>The final change adds a data member called <code>id_</code> which - is preceded by another pragma. In ODB every persistent object must - have a unique, within its class, identifier. Or, in other words, - no two persistent instances of the same type have equal - identifiers. For our class we use an integer id. The - <code>db id auto</code> pragma that precedes the <code>id_</code> - member tells the ODB compiler that the following member is the - object's identifier. The <code>auto</code> specifier indicates that it - is a database-assigned id. A unique id will be automatically generated - by the database and assigned to the object when it is made - persistent.</p> + is preceded by another pragma. In ODB every persistent object normally + has a unique, within its class, identifier. Or, in other words, no two + persistent instances of the same type have equal identifiers. While it + is possible to define a persistent class without an object id, the number + of database operations that can be performed on such a class is limited. + For our class we use an integer id. The <code>db id auto</code> + pragma that precedes the <code>id_</code> member tells the ODB compiler + that the following member is the object's identifier. The + <code>auto</code> specifier indicates that it is a database-assigned + id. A unique id will be automatically generated by the database and + assigned to the object when it is made persistent.</p> <p>In this example we chose to add an identifier because none of the existing members could serve the same purpose. However, if @@ -1226,7 +1227,7 @@ private: identification (SSN in the United States or ID/passport number in other countries), then we could use that as an id. Or, if we stored an email associated with each person, then we could - have used that since each person is presumed to have a unique + have used that if each person is presumed to have a unique email address, for example:</p> <pre class="cxx"> @@ -2203,7 +2204,7 @@ class person <a href="#4.4">Section 4.4, "Query Result"</a>).</p> <p>The object id can be of a simple or composite (<a href="#7.2.1">Section - 7.2.1, "Composite Object Ids"</a>) value type which should be + 7.2.1, "Composite Object Ids"</a>) value type and should be default-constructible.</p> <p>If an object class has private or protected non-transient data |