#include <table.h>
Public Types | |
typedef Row | row_type |
The type of the row the table contains. | |
typedef std::auto_ptr< Row > | row_ptr |
typedef std::list< Row > | row_list |
typedef std::auto_ptr< row_list > | row_list_ptr |
Public Member Functions | |
virtual | ~table () |
The destructor. | |
virtual void | insert (row_type &row) |
Add a new row. | |
virtual void | update (row_type &row) |
Update the details of an existing row. | |
virtual void | erase (row_type &row) |
Erase (remove) a row. | |
virtual void | refresh (row_type &row) |
Refresh a row (synchronise with current database state). | |
Protected Member Functions | |
table (pqxxobject::transaction &tran) | |
The constructor. | |
virtual row_ptr | find_one (const std::string &query) |
Find a single row from the database. | |
virtual row_list_ptr | find_many (const std::string &query) |
Find multiple rows from the database. | |
Protected Attributes | |
pqxxobject::transaction & | m_transaction |
This class provides methods to simplify table access for classes which represent database tables. Methods are provided to find single and multiple rows and to insert, update and delete rows from the table. A default method for modifying the database is also provided, but this should be overridden in all but the simplest classes.
Definition at line 41 of file table.h.
|
Definition at line 47 of file table.h. Referenced by pqxxobject::table< Row >::find_many(). |
|
Definition at line 48 of file table.h. Referenced by pqxxobject::table< Row >::find_many(). |
|
Definition at line 46 of file table.h. Referenced by pqxxobject::table< Row >::find_many(), and pqxxobject::table< Row >::find_one(). |
|
The type of the row the table contains.
Definition at line 45 of file table.h. Referenced by pqxxobject::table< Row >::erase(), pqxxobject::table< Row >::find_many(), pqxxobject::table< Row >::find_one(), pqxxobject::table< Row >::insert(), pqxxobject::table< Row >::refresh(), and pqxxobject::table< Row >::update(). |
|
The constructor.
Definition at line 60 of file table.h. References pqxxobject::table< Row >::m_transaction. |
|
The destructor.
|
|
Erase (remove) a row.
Definition at line 98 of file table.h. References pqxxobject::table< Row >::m_transaction, and pqxxobject::table< Row >::row_type. |
|
Find multiple rows from the database.
Definition at line 160 of file table.h. References pqxxobject::transaction::begin(), pqxxobject::transaction::end(), pqxxobject::transaction::exec(), pqxxobject::table< Row >::m_transaction, pqxxobject::table< Row >::row_list, pqxxobject::table< Row >::row_list_ptr, pqxxobject::table< Row >::row_ptr, and pqxxobject::table< Row >::row_type. |
|
Find a single row from the database.
Definition at line 122 of file table.h. References pqxxobject::transaction::begin(), pqxxobject::transaction::end(), pqxxobject::transaction::exec(), pqxxobject::table< Row >::m_transaction, pqxxobject::table< Row >::row_ptr, and pqxxobject::table< Row >::row_type. |
|
Add a new row.
Definition at line 76 of file table.h. References pqxxobject::table< Row >::m_transaction, and pqxxobject::table< Row >::row_type. |
|
Refresh a row (synchronise with current database state).
Definition at line 109 of file table.h. References pqxxobject::table< Row >::m_transaction, and pqxxobject::table< Row >::row_type. |
|
Update the details of an existing row.
Definition at line 87 of file table.h. References pqxxobject::table< Row >::m_transaction, and pqxxobject::table< Row >::row_type. |
|