#include <table.h>
Public Types | |
typedef Row | row_type |
The type of the row the table contains. | |
typedef Row::row_ptr | row_ptr |
Row object pointer. | |
typedef std::list< Row > | row_list |
List of rows. | |
typedef std::auto_ptr< row_list > | row_list_ptr |
List of rows pointer. | |
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.
Definition at line 57 of file table.h.
|
List of rows.
Definition at line 65 of file table.h. Referenced by pqxxobject::table< Row >::find_many(). |
|
List of rows pointer.
Definition at line 67 of file table.h. Referenced by pqxxobject::table< Row >::find_many(). |
|
Row object pointer.
|
|
The type of the row the table contains.
Definition at line 61 of file table.h. Referenced by pqxxobject::table< Row >::erase(), pqxxobject::table< Row >::insert(), pqxxobject::table< Row >::refresh(), and pqxxobject::table< Row >::update(). |
|
The constructor.
Definition at line 79 of file table.h. References pqxxobject::table< Row >::m_transaction. |
|
The destructor.
|
|
Erase (remove) a row.
Definition at line 116 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 176 of file table.h. References pqxxobject::transaction::abort(), pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), pqxxobject::transaction::exec(), pqxxobject::table< Row >::m_transaction, pqxxobject::table< Row >::row_list, and pqxxobject::table< Row >::row_list_ptr. |
|
Find a single row from the database.
Definition at line 140 of file table.h. References pqxxobject::transaction::abort(), pqxxobject::transaction::begin(), pqxxobject::transaction::commit(), pqxxobject::transaction::exec(), and pqxxobject::table< Row >::m_transaction. |
|
Add a new row.
Definition at line 94 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 127 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 105 of file table.h. References pqxxobject::table< Row >::m_transaction, and pqxxobject::table< Row >::row_type. |
|