#include <row.h>
Inheritance diagram for pqxxobject::row< Row >:
Public Types | |
typedef std::auto_ptr< Row > | row_ptr |
Row object pointer. | |
Public Member Functions | |
row () | |
The constructor. | |
row (row_state status, bool modified=false) | |
The constructor. | |
row (const row &rhs) | |
The copy constructor. | |
virtual | ~row () |
The destructor. | |
row & | operator= (const row &rhs) |
The assignment operator. | |
Static Public Member Functions | |
row_ptr | create (pqxx::result::const_iterator row, pqxxobject::transaction &tran) |
Create a new row object from an SQL result set. | |
Private Member Functions | |
bool | get_checkpoint () const |
Find if a checkpoint object exists for this row. | |
void | begin_impl (pqxxobject::transaction &tran) |
Begin a transaction (checkpoint). | |
void | abort_impl (pqxxobject::transaction &tran) |
Recover from transaction abort (roll back to checkpoint). | |
void | commit_impl (pqxxobject::transaction &tran) |
Recover from transaction commit (refresh or roll back to checkpoint). | |
Private Attributes | |
Row * | m_checkpoint |
Checkpoint object, used to save state for transaction rollback. |
The class represents a single row in a database table (or result set). This class should be derived from by your own row class. For example:
Your class should provide:class Address : public libpqxxobject::row<Address> { private: libpqxx::column<int> m_id; // Primary key libpqxx::column<std::string> name; // Name libpqxx::column<std::string> street; // Street [...] }
This will be used by the companion table object (if any) when recreating objects from the database.
Definition at line 82 of file row.h.
|
Row object pointer.
Definition at line 90 of file row.h. Referenced by pqxxobject::row< Row >::create(). |
|
The constructor.
Definition at line 93 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
The constructor.
Definition at line 103 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
The copy constructor.
Definition at line 113 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
The destructor.
Definition at line 120 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
Recover from transaction abort (roll back to checkpoint). This default method does nothing and should be overridden by derived classes.
Implements pqxxobject::row_base. Definition at line 189 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
Begin a transaction (checkpoint). This default method does nothing and should be overridden by derived classes.
Implements pqxxobject::row_base. Definition at line 167 of file row.h. References pqxxobject::transaction::get_checkpoint(), and pqxxobject::row< Row >::m_checkpoint. |
|
Recover from transaction commit (refresh or roll back to checkpoint). This default method does nothing and should be overridden by derived classes.
Implements pqxxobject::row_base. Definition at line 220 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
Create a new row object from an SQL result set.
Definition at line 152 of file row.h. References pqxxobject::row< Row >::row_ptr. |
|
Find if a checkpoint object exists for this row.
Implements pqxxobject::row_base. Definition at line 162 of file row.h. References pqxxobject::row< Row >::m_checkpoint. |
|
The assignment operator.
Definition at line 136 of file row.h. References pqxxobject::row< Row >::m_checkpoint, and pqxxobject::row_base::operator=(). |
|
Checkpoint object, used to save state for transaction rollback.
Definition at line 86 of file row.h. Referenced by pqxxobject::row< Row >::abort_impl(), pqxxobject::row< Row >::begin_impl(), pqxxobject::row< Row >::commit_impl(), pqxxobject::row< Row >::get_checkpoint(), pqxxobject::row< Row >::operator=(), pqxxobject::row< Row >::row(), and pqxxobject::row< Row >::~row(). |