<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>Wt: Database Objects (Wt::Dbo)</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css" /> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">Wt  <span id="projectnumber">3.2.3</span> </div> </td> </tr> </tbody> </table> </div> <!-- Generated by Doxygen 1.7.5.1 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#nested-classes">Classes</a> | <a href="#enum-members">Enumerations</a> | <a href="#func-members">Functions</a> | <a href="#var-members">Variables</a> </div> <div class="headertitle"> <div class="title">Database Objects (Wt::Dbo)</div> </div> </div> <div class="contents"> <p>An implemenation of an Object Relational Mapping layer. <a href="#details">More...</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="nested-classes"></a> Classes</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1ForeignKeyConstraint.html">Wt::Dbo::ForeignKeyConstraint</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Type that indicates one or more foreign key constraints. <a href="classWt_1_1Dbo_1_1ForeignKeyConstraint.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1ptr__tuple.html">Wt::Dbo::ptr_tuple< T0, T1,, T9 ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A utility class for defining a tuple of database objects. <a href="structWt_1_1Dbo_1_1ptr__tuple.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1SqlStatement.html">Wt::Dbo::SqlStatement</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for a prepared SQL statement. <a href="classWt_1_1Dbo_1_1SqlStatement.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1backend_1_1Firebird.html">Wt::Dbo::backend::Firebird</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A Firebird connection. <a href="classWt_1_1Dbo_1_1backend_1_1Firebird.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1backend_1_1Postgres.html">Wt::Dbo::backend::Postgres</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A PostgreSQL connection. <a href="classWt_1_1Dbo_1_1backend_1_1Postgres.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1backend_1_1Sqlite3.html">Wt::Dbo::backend::Sqlite3</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An SQLite3 connection. <a href="classWt_1_1Dbo_1_1backend_1_1Sqlite3.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1collection.html">Wt::Dbo::collection< C ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">An STL container for iterating query results. <a href="classWt_1_1Dbo_1_1collection.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1Exception.html">Wt::Dbo::Exception</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Exception base class for Wt::Dbo. <a href="classWt_1_1Dbo_1_1Exception.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1StaleObjectException.html">Wt::Dbo::StaleObjectException</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Exception thrown when Wt::Dbo detects a concurrent modification <a href="classWt_1_1Dbo_1_1StaleObjectException.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1ObjectNotFoundException.html">Wt::Dbo::ObjectNotFoundException</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Exception thrown when trying to load a non-existing object. <a href="classWt_1_1Dbo_1_1ObjectNotFoundException.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1NoUniqueResultException.html">Wt::Dbo::NoUniqueResultException</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Exception thrown when a query unexpectedly finds a non-unique result. <a href="classWt_1_1Dbo_1_1NoUniqueResultException.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1FixedSqlConnectionPool.html">Wt::Dbo::FixedSqlConnectionPool</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A connection pool of fixed size. <a href="classWt_1_1Dbo_1_1FixedSqlConnectionPool.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1dbo__default__traits.html">Wt::Dbo::dbo_default_traits</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Default traits for a class mapped with Wt::Dbo. <a href="structWt_1_1Dbo_1_1dbo__default__traits.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1dbo__traits.html">Wt::Dbo::dbo_traits< C ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Traits for a class mapped with Wt::Dbo. <a href="structWt_1_1Dbo_1_1dbo__traits.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1Dbo.html">Wt::Dbo::Dbo< C ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A base class for database objects. <a href="classWt_1_1Dbo_1_1Dbo.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1ptr.html">Wt::Dbo::ptr< C ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A smart pointer for a database object. <a href="classWt_1_1Dbo_1_1ptr.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1Query.html">Wt::Dbo::Query< Result, BindStrategy ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A database query. <a href="classWt_1_1Dbo_1_1Query.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1QueryModel.html">Wt::Dbo::QueryModel< Result ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A Wt MVC Model to view/edit query results. <a href="classWt_1_1Dbo_1_1QueryModel.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1Session.html">Wt::Dbo::Session</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A database session. <a href="classWt_1_1Dbo_1_1Session.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1SqlConnection.html">Wt::Dbo::SqlConnection</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for an SQL connection. <a href="classWt_1_1Dbo_1_1SqlConnection.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1SqlConnectionPool.html">Wt::Dbo::SqlConnectionPool</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for a SQL connection pool. <a href="classWt_1_1Dbo_1_1SqlConnectionPool.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html">Wt::Dbo::sql_value_traits< V, Enable ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Traits class for value types. <a href="structWt_1_1Dbo_1_1sql__value__traits.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1FieldInfo.html">Wt::Dbo::FieldInfo</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Description of a field. <a href="classWt_1_1Dbo_1_1FieldInfo.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="structWt_1_1Dbo_1_1query__result__traits.html">Wt::Dbo::query_result_traits< Result ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Traits class for result types. <a href="structWt_1_1Dbo_1_1query__result__traits.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1Transaction.html">Wt::Dbo::Transaction</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A database transaction. <a href="classWt_1_1Dbo_1_1Transaction.html#details">More...</a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="classWt_1_1Dbo_1_1weak__ptr.html">Wt::Dbo::weak_ptr< C ></a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A weak pointer for a database object. <a href="classWt_1_1Dbo_1_1weak__ptr.html#details">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="enum-members"></a> Enumerations</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga1d0ec6819b1bf5b7a88ad030b91ca564">Wt::Dbo::RelationType</a> { <a class="el" href="group__dbo.html#gga1d0ec6819b1bf5b7a88ad030b91ca564a32d7393c325724244671b18be53058fa">Wt::Dbo::ManyToOne</a>, <a class="el" href="group__dbo.html#gga1d0ec6819b1bf5b7a88ad030b91ca564ad0bd477ec215a878e0758cce8494af24">Wt::Dbo::ManyToMany</a> }</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Type of an SQL relation. <a href="group__dbo.html#ga1d0ec6819b1bf5b7a88ad030b91ca564">More...</a><br/></td></tr> <tr><td colspan="2"><h2><a name="func-members"></a> Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ga3815c99266412f8ff53cf4c73546d918"></a><!-- doxytag: member="dbo::operator|" ref="ga3815c99266412f8ff53cf4c73546d918" args="(ForeignKeyConstraint lhs, ForeignKeyConstraint rhs)" --> ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga3815c99266412f8ff53cf4c73546d918">Wt::Dbo::operator|</a> (ForeignKeyConstraint lhs, ForeignKeyConstraint rhs)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Combines two constraints. <br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , typename V > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga42c50bd3bfc38ad8c810b30b279b0ba6">Wt::Dbo::id</a> (Action &action, V &value, const std::string &name="id", int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps a natural primary key (id) field. <a href="#ga42c50bd3bfc38ad8c810b30b279b0ba6"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#gaf6e683b7a7124e562134caf155ef0080">Wt::Dbo::id</a> (Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints, int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps a natural primary key (id) field that is a foreign key. <a href="#gaf6e683b7a7124e562134caf155ef0080"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , typename V > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga864a2e134149e7f614f45967777992c7">Wt::Dbo::field</a> (Action &action, V &value, const std::string &name, int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps a database object field. <a href="#ga864a2e134149e7f614f45967777992c7"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba">Wt::Dbo::belongsTo</a> (Action &action, ptr< C > &value, const std::string &name=std::string(), int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. <a href="#gaa3de862f9544c4d30b8cbcac4b50feba"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga63aeb211ec8096a9f7acd3964de0eaed">Wt::Dbo::belongsTo</a> (Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints, int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. <a href="#ga63aeb211ec8096a9f7acd3964de0eaed"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#gab5e93ae896ad21f7c8eda8c36c2161f9">Wt::Dbo::belongsTo</a> (Action &action, ptr< C > &value, ForeignKeyConstraint constraints, int size=-1)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. <a href="#gab5e93ae896ad21f7c8eda8c36c2161f9"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga00a060d5f4764f673948989f21837548">Wt::Dbo::hasOne</a> (Action &action, weak_ptr< C > &value, const std::string &name=std::string())</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "One"-side of a OneToOne relation. <a href="#ga00a060d5f4764f673948989f21837548"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363">Wt::Dbo::hasMany</a> (Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name=std::string())</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "Many"-side of a ManyToOne or ManyToMany relation. <a href="#ga570b71f937c991b000b9db01b327a363"></a><br/></td></tr> <tr><td class="memTemplParams" colspan="2">template<class Action , class C > </td></tr> <tr><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga6daca8218568c4cc868821a22b292b67">Wt::Dbo::hasMany</a> (Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name, const std::string &joinId, ForeignKeyConstraint constraints=NotNull)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Maps the "Many"-side of a ManyToMany relation. <a href="#ga6daca8218568c4cc868821a22b292b67"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="var-members"></a> Variables</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga538d2126ffe7787d14e72bfcdb266ff0">Wt::Dbo::NotNull</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A constraint that prevents a <code>null</code> ptr. <a href="#ga538d2126ffe7787d14e72bfcdb266ff0"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga766c0992c040bee5b9b1f4dcfa18d11f">Wt::Dbo::OnUpdateCascade</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A constraint that cascades updates. <a href="#ga766c0992c040bee5b9b1f4dcfa18d11f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#ga5d603e49ff5ce63182c5e5d07f08fb21">Wt::Dbo::OnUpdateSetNull</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A constraint that cascades updates. <a href="#ga5d603e49ff5ce63182c5e5d07f08fb21"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#gaf873ff817052bf26092f89ab7cf9866f">Wt::Dbo::OnDeleteCascade</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A constraint that cascades deletes. <a href="#gaf873ff817052bf26092f89ab7cf9866f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">const ForeignKeyConstraint </td><td class="memItemRight" valign="bottom"><a class="el" href="group__dbo.html#gaed6ad23f771e2c07db12249e1f6af390">Wt::Dbo::OnDeleteSetNull</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">A constraint that cascades deletes. <a href="#gaed6ad23f771e2c07db12249e1f6af390"></a><br/></td></tr> </table> <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> <p>An implemenation of an Object Relational Mapping layer. </p> <p>For an introduction, see the <a href="../../tutorial/dbo.html">tutorial</a>. </p> <hr/><h2>Enumeration Type Documentation</h2> <a class="anchor" id="ga1d0ec6819b1bf5b7a88ad030b91ca564"></a><!-- doxytag: member="Wt::Dbo::RelationType" ref="ga1d0ec6819b1bf5b7a88ad030b91ca564" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__dbo.html#ga1d0ec6819b1bf5b7a88ad030b91ca564">Wt::Dbo::RelationType</a></td> </tr> </table> </div> <div class="memdoc"> <p>Type of an SQL relation. </p> <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><em><a class="anchor" id="gga1d0ec6819b1bf5b7a88ad030b91ca564a32d7393c325724244671b18be53058fa"></a><!-- doxytag: member="ManyToOne" ref="gga1d0ec6819b1bf5b7a88ad030b91ca564a32d7393c325724244671b18be53058fa" args="" -->ManyToOne</em> </td><td> <p>Many-to-One relationship. </p> </td></tr> <tr><td valign="top"><em><a class="anchor" id="gga1d0ec6819b1bf5b7a88ad030b91ca564ad0bd477ec215a878e0758cce8494af24"></a><!-- doxytag: member="ManyToMany" ref="gga1d0ec6819b1bf5b7a88ad030b91ca564ad0bd477ec215a878e0758cce8494af24" args="" -->ManyToMany</em> </td><td> <p>Many-to-Many relationship. </p> </td></tr> </table> </dd> </dl> </div> </div> <hr/><h2>Function Documentation</h2> <a class="anchor" id="gaa3de862f9544c4d30b8cbcac4b50feba"></a><!-- doxytag: member="Wt::Dbo::belongsTo" ref="gaa3de862f9544c4d30b8cbcac4b50feba" args="(Action &action, ptr< C > &value, const std::string &name=std::string(), int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::belongsTo </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ptr< C > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em> = <code>std::string()</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. </p> <p>This function binds the pointer field <code>value</code> to the database foreign key field(s) <code>name</code> <code>+ "_" +</code> (C's primary key(s)).</p> <p>If the name is omitted or empty, then C's mapped table name is used.</p> <p>A <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> will usually have a counter-part <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> or <a class="el" href="group__dbo.html#ga00a060d5f4764f673948989f21837548" title="Maps the "One"-side of a OneToOne relation.">hasOne()</a> declaration in the referenced class <code>C</code>.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> </dd></dl> </div> </div> <a class="anchor" id="ga63aeb211ec8096a9f7acd3964de0eaed"></a><!-- doxytag: member="Wt::Dbo::belongsTo" ref="ga63aeb211ec8096a9f7acd3964de0eaed" args="(Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints, int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::belongsTo </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ptr< C > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ForeignKeyConstraint </td> <td class="paramname"><em>constraints</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. </p> <p>This overloaded method allows to specify constraints for the foreign key.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> </dd></dl> </div> </div> <a class="anchor" id="gab5e93ae896ad21f7c8eda8c36c2161f9"></a><!-- doxytag: member="Wt::Dbo::belongsTo" ref="gab5e93ae896ad21f7c8eda8c36c2161f9" args="(Action &action, ptr< C > &value, ForeignKeyConstraint constraints, int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::belongsTo </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ptr< C > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ForeignKeyConstraint </td> <td class="paramname"><em>constraints</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation. </p> <p>This overloaded method allows to specify constraints for the foreign key.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> </dd></dl> </div> </div> <a class="anchor" id="ga864a2e134149e7f614f45967777992c7"></a><!-- doxytag: member="Wt::Dbo::field" ref="ga864a2e134149e7f614f45967777992c7" args="(Action &action, V &value, const std::string &name, int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , typename V > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::field </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">V & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps a database object field. </p> <p>This function binds the field <code>value</code> to the database field <code>name</code>.</p> <p>The optional <code>size</code> may be used as a hint for the needed storage. It is only useful for <em>std::string</em> or <em><a class="el" href="classWt_1_1WString.html" title="A value class which describes a locale-aware unicode string.">Wt::WString</a></em> fields, and causes the schema to use a <code>varchar(</code><em><code>size</code></em><code>)</code> for storing the field instead of an unlimited length string type.</p> <p>You may want to specialize this method for a particular composite type which should be persisted in multiple database fields but not as a separate table (e.g. for natural composite primary keys, see <a class="el" href="group__dbo.html#ga42c50bd3bfc38ad8c810b30b279b0ba6" title="Maps a natural primary key (id) field.">id()</a>).</p> <p>For example: </p> <div class="fragment"><pre class="fragment"> <span class="keyword">struct </span>Coordinate { <span class="keywordtype">int</span> x, y; }; <span class="keyword">namespace </span>Wt { <span class="keyword">namespace </span>Dbo { <span class="keyword">template</span> <<span class="keyword">class</span> Action> <span class="keywordtype">void</span> <a class="code" href="group__dbo.html#ga864a2e134149e7f614f45967777992c7" title="Maps a database object field.">field</a>(Action& action, Coordinate& coordinate, <span class="keyword">const</span> std::string& name, <span class="keywordtype">int</span> size = -1) { <a class="code" href="group__dbo.html#ga864a2e134149e7f614f45967777992c7" title="Maps a database object field.">field</a>(action, coordinate.x, name + <span class="stringliteral">"_x"</span>); <a class="code" href="group__dbo.html#ga864a2e134149e7f614f45967777992c7" title="Maps a database object field.">field</a>(action, coordinate.y, name + <span class="stringliteral">"_y"</span>); } } <span class="comment">// namespace Dbo</span> } <span class="comment">// namespace Wt</span> </pre></div><p>To support a custom type that needs to be persisted as a single field, you should specialize <a class="el" href="structWt_1_1Dbo_1_1sql__value__traits.html" title="Traits class for value types.">sql_value_traits</a> instead. </p> </div> </div> <a class="anchor" id="ga570b71f937c991b000b9db01b327a363"></a><!-- doxytag: member="Wt::Dbo::hasMany" ref="ga570b71f937c991b000b9db01b327a363" args="(Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name=std::string())" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::hasMany </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">collection< ptr< C > > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">RelationType </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em> = <code>std::string()</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "Many"-side of a ManyToOne or ManyToMany relation. </p> <p>This function binds the collection field <code>value</code> to contain objects (of type <code>C</code>) that holds the associated objects: reading from the collection and adding or removing objects from the collection results in SQL statements.</p> <p>For a <a class="el" href="group__dbo.html#gga1d0ec6819b1bf5b7a88ad030b91ca564a32d7393c325724244671b18be53058fa">ManyToOne</a> relation, the query is defined by the database field(s) <code>name</code> <code>+ "_" + </code> (C's primary key(s)), in the mapped table for C. This should be the same <em>name</em> as passed to the matching <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> method for the other side of the relation. If the <code>name</code> is omitted or empty, then the mapped table name of the current class is used.</p> <p>For a <a class="el" href="group__dbo.html#gga1d0ec6819b1bf5b7a88ad030b91ca564ad0bd477ec215a878e0758cce8494af24">ManyToMany</a> relation, the <code>name</code> is the name of a linker table (this linker table may be schema qualified, e.g. <code>"myschema.posts_tags"</code>. Thus, also for a ManyToMany relation, both sides of the relationship will have the same <code>name</code> passed to them. In the join table, this side of the the relation will be referenced using the table name <code>+ "_" + </code> (primary key(s)) of the current class.</p> <p>A <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> must have a counter-part <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> or <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> declaration in the referenced class <code>C</code>.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> </dd></dl> </div> </div> <a class="anchor" id="ga6daca8218568c4cc868821a22b292b67"></a><!-- doxytag: member="Wt::Dbo::hasMany" ref="ga6daca8218568c4cc868821a22b292b67" args="(Action &action, collection< ptr< C > > &value, RelationType type, const std::string &name, const std::string &joinId, ForeignKeyConstraint constraints=NotNull)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::hasMany </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">collection< ptr< C > > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">RelationType </td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>joinId</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ForeignKeyConstraint </td> <td class="paramname"><em>constraints</em> = <code>NotNull</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "Many"-side of a ManyToMany relation. </p> <p>This function binds the collection field <code>value</code> to contain objects (of type <code>C</code>).</p> <p>This overloaded method allows to customize the field name of the foreign id in the join table, and specify constraints for this foreign key. The only allowed value for <code>type</code> is <a class="el" href="group__dbo.html#gga1d0ec6819b1bf5b7a88ad030b91ca564ad0bd477ec215a878e0758cce8494af24">ManyToMany</a>.</p> <p>The <code>joinId</code> is used to reference this side of the relationship in the join table. If <code>joinId</code> is left blank, the value will be table name <code>+ "_" +</code> (primary key(s)) of the current class.</p> <p>A <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> must have a counter-part <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> or <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> declaration in the referenced class <code>C</code>.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> </dd></dl> </div> </div> <a class="anchor" id="ga00a060d5f4764f673948989f21837548"></a><!-- doxytag: member="Wt::Dbo::hasOne" ref="ga00a060d5f4764f673948989f21837548" args="(Action &action, weak_ptr< C > &value, const std::string &name=std::string())" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::hasOne </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">weak_ptr< C > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em> = <code>std::string()</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps the "One"-side of a OneToOne relation. </p> <p>This function binds the <a class="el" href="classWt_1_1Dbo_1_1weak__ptr.html" title="A weak pointer for a database object.">weak_ptr</a> field <code>value</code> to the associated object (of type <code>C</code>).</p> <p>A <a class="el" href="classWt_1_1Dbo_1_1weak__ptr.html" title="A weak pointer for a database object.">weak_ptr</a> is required here to break the cycle that would otherwise be created by the <a class="el" href="group__dbo.html#ga00a060d5f4764f673948989f21837548" title="Maps the "One"-side of a OneToOne relation.">hasOne()</a> and <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> associations. The value is not actually stored but defined in terms of a SQL query (not that different from how a <a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> call backs a collection by a SQL query).</p> <p>The query is defined by the database field(s) <code>name</code> <code>+ "_" + </code> (C's primary key(s)), in the mapped table for C. This should be the same <em>name</em> as passed to the matching <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> method for the other side of the relation. If the <code>name</code> is omitted or empty, then the mapped table name of the current class is used.</p> <p>A <a class="el" href="group__dbo.html#ga00a060d5f4764f673948989f21837548" title="Maps the "One"-side of a OneToOne relation.">hasOne()</a> must have a counter-part <a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> declaration in the referenced class <code>C</code>.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#gaa3de862f9544c4d30b8cbcac4b50feba" title="Maps the "One"-side (foreign key) of a ManyToOne or OneToOne relation.">belongsTo()</a> </dd></dl> </div> </div> <a class="anchor" id="ga42c50bd3bfc38ad8c810b30b279b0ba6"></a><!-- doxytag: member="Wt::Dbo::id" ref="ga42c50bd3bfc38ad8c810b30b279b0ba6" args="(Action &action, V &value, const std::string &name="id", int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , typename V > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::id </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">V & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em> = <code>"id"</code>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps a natural primary key (id) field. </p> <p>A natural primary key field is optional. If you define one and its type is not <code>long long</code>, you must specialize <a class="el" href="structWt_1_1Dbo_1_1dbo__traits.html" title="Traits for a class mapped with Wt::Dbo.">Wt::Dbo::dbo_traits</a> to match the type <code>V</code> as the IdType for this class. When not specified for a class, an auto-generated surrogate key field is used with the name specified by <a class="el" href="structWt_1_1Dbo_1_1dbo__traits.html#a44c5455df89390fae082aadf7cf1bc13" title="Configures the surrogate primary key field.">Wt::Dbo::dbo_traits::surrogateIdField()</a>, which defaults to "id".</p> <p>Unlike the default surrogate key, a natural id is not auto-generated and thus you need to give each object a unique value when creating a new object.</p> <p>The id may be a composite type. In that case, you need to specialize <a class="el" href="group__dbo.html#ga864a2e134149e7f614f45967777992c7" title="Maps a database object field.">Wt::Dbo::field()</a>. </p> </div> </div> <a class="anchor" id="gaf6e683b7a7124e562134caf155ef0080"></a><!-- doxytag: member="Wt::Dbo::id" ref="gaf6e683b7a7124e562134caf155ef0080" args="(Action &action, ptr< C > &value, const std::string &name, ForeignKeyConstraint constraints, int size=-1)" --> <div class="memitem"> <div class="memproto"> <div class="memtemplate"> template<class Action , class C > </div> <table class="memname"> <tr> <td class="memname">void Wt::Dbo::id </td> <td>(</td> <td class="paramtype">Action & </td> <td class="paramname"><em>action</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ptr< C > & </td> <td class="paramname"><em>value</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const std::string & </td> <td class="paramname"><em>name</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">ForeignKeyConstraint </td> <td class="paramname"><em>constraints</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int </td> <td class="paramname"><em>size</em> = <code>-1</code> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div> <div class="memdoc"> <p>Maps a natural primary key (id) field that is a foreign key. </p> <p>This overloaded method allows to specify constraints for the foreign key.</p> <dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__dbo.html#ga570b71f937c991b000b9db01b327a363" title="Maps the "Many"-side of a ManyToOne or ManyToMany relation.">hasMany()</a> </dd></dl> </div> </div> <hr/><h2>Variable Documentation</h2> <a class="anchor" id="ga538d2126ffe7787d14e72bfcdb266ff0"></a><!-- doxytag: member="Wt::Dbo::NotNull" ref="ga538d2126ffe7787d14e72bfcdb266ff0" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const ForeignKeyConstraint <a class="el" href="group__dbo.html#ga538d2126ffe7787d14e72bfcdb266ff0">Wt::Dbo::NotNull</a></td> </tr> </table> </div> <div class="memdoc"> <p>A constraint that prevents a <code>null</code> ptr. </p> <p>A database constraint which prevents that a ptr references no object and has a value of <code>null</code>. </p> </div> </div> <a class="anchor" id="gaf873ff817052bf26092f89ab7cf9866f"></a><!-- doxytag: member="Wt::Dbo::OnDeleteCascade" ref="gaf873ff817052bf26092f89ab7cf9866f" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const ForeignKeyConstraint <a class="el" href="group__dbo.html#gaf873ff817052bf26092f89ab7cf9866f">Wt::Dbo::OnDeleteCascade</a></td> </tr> </table> </div> <div class="memdoc"> <p>A constraint that cascades deletes. </p> <p>A database constraint which propagates deletes of the referenced object to also delete the object(s) that reference it.</p> <dl class="note"><dt><b>Note:</b></dt><dd>This constraint only affects the database schema creation. </dd></dl> </div> </div> <a class="anchor" id="gaed6ad23f771e2c07db12249e1f6af390"></a><!-- doxytag: member="Wt::Dbo::OnDeleteSetNull" ref="gaed6ad23f771e2c07db12249e1f6af390" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const ForeignKeyConstraint <a class="el" href="group__dbo.html#gaed6ad23f771e2c07db12249e1f6af390">Wt::Dbo::OnDeleteSetNull</a></td> </tr> </table> </div> <div class="memdoc"> <p>A constraint that cascades deletes. </p> <p>A database constraint which propagates deletes of the referenced object to also delete the objects that reference.</p> <dl class="note"><dt><b>Note:</b></dt><dd>This constraint only affects the database schema creation. </dd></dl> </div> </div> <a class="anchor" id="ga766c0992c040bee5b9b1f4dcfa18d11f"></a><!-- doxytag: member="Wt::Dbo::OnUpdateCascade" ref="ga766c0992c040bee5b9b1f4dcfa18d11f" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const ForeignKeyConstraint <a class="el" href="group__dbo.html#ga766c0992c040bee5b9b1f4dcfa18d11f">Wt::Dbo::OnUpdateCascade</a></td> </tr> </table> </div> <div class="memdoc"> <p>A constraint that cascades updates. </p> <p>A database constraint which propagates updates to the natural primary key in the referenced table.</p> <dl class="note"><dt><b>Note:</b></dt><dd>This constraint only affects the database schema creation. Currently it is not possible to update a natural Id of an already saved object through Dbo itself. </dd></dl> </div> </div> <a class="anchor" id="ga5d603e49ff5ce63182c5e5d07f08fb21"></a><!-- doxytag: member="Wt::Dbo::OnUpdateSetNull" ref="ga5d603e49ff5ce63182c5e5d07f08fb21" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">const ForeignKeyConstraint <a class="el" href="group__dbo.html#ga5d603e49ff5ce63182c5e5d07f08fb21">Wt::Dbo::OnUpdateSetNull</a></td> </tr> </table> </div> <div class="memdoc"> <p>A constraint that cascades updates. </p> <p>A database constraint which sets the value of the ptr to null when the referenced primary key changes.</p> <dl class="note"><dt><b>Note:</b></dt><dd>This constraint only affects the database schema creation. Currently it is not possible to update a natural Id of an already saved object through Dbo itself. </dd></dl> </div> </div> </div> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark"> </span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark"> </span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark"> </span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark"> </span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark"> </span>Enumerator</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <hr size="1"><address style="text-align: right; margin: 3px"><small> Generated on Thu Nov 1 2012 for <a href="http://www.webtoolkit.eu/wt">the C++ Web Toolkit (Wt)</a> by <a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" border="0" style="vertical-align: middle; display: inline-block; height: 2em"></a> 1.7.5.1</small></address> </body> </html>