|
PTLib
Version 2.14.3
|
Database Row Class This class functions as a simple wrapper of the Statement class to fetch/Save data to the Datasource. More...
#include <podbc.h>


Public Member Functions | |
| Row (RecordSet &recordSet) | |
| Constructor. More... | |
| PINDEX | Columns () const |
| Columns. More... | |
| PStringArray | ColumnNames () const |
| Retrieve the Column Names. More... | |
| PINDEX | ColumnByName (const PCaselessString &columnName) const |
ColumnByName returns the column number of the column name If not found returns column value of 0; More... | |
| Field & | Column (PINDEX column) const |
| Retrieve Field Data given the specifed column. More... | |
| Field & | Column (const PString &name) const |
| Retreive Field Data given the Column Name. More... | |
| Field & | operator[] (PINDEX column) const |
| Retrieve Field Data given specified column. More... | |
| Field & | operator[] (const PString &columnName) const |
| Retrieve Field Data given the column Name. More... | |
| PString | ColumnName (PINDEX column) const |
| Column Name. More... | |
| unsigned | ColumnType (PINDEX column) const |
| ColumnTypes. More... | |
| PINDEX | ColumnSize (PINDEX column) const |
| Column Size. More... | |
| unsigned | ColumnScale (PINDEX column) const |
| Column Scale. More... | |
| unsigned | ColumnPrecision (PINDEX column) const |
ColumnPrecision Get the Number of Decimal places if Precision is set the precision is set to the lessor of the Two. More... | |
| bool | IsColumnNullable (PINDEX column) const |
| IsColumn Nullable. More... | |
| bool | IsColumnUpdatable (PINDEX column) const |
| IsColumn Updateable ie is not ReadOnly. More... | |
| bool | IsColumnAutoIndex (PINDEX column) const |
| IsColumnAutoIndex (ie don't give default Value) More... | |
| void | SetNewRow () |
| Make this row a new one. More... | |
| bool | MoveTo (RowIndex row) |
| Move to Specified Row. More... | |
| bool | Move (int offset) |
| Move to row relative to current position. More... | |
| bool | First () |
| First record. More... | |
| bool | Next () |
| Next record. More... | |
| bool | Previous () |
| Previous record. More... | |
| bool | Last () |
| Last record. More... | |
| bool | Delete (RowIndex rowIndex=0) |
Delete the Current Record from the | |
| bool | Commit () |
| Post the Row back to the Database. More... | |
| RowIndex | GetRowIndex () const |
| PINDEX | Rows () |
| PINDEX | ColumnCount () |
| bool | PostNew () |
| bool | PostUpdate () |
| bool | Post () |
| bool | Navigate (RowIndex row) |
Public Member Functions inherited from PObject | |
| unsigned | GetTraceContextIdentifier () const |
| Get PTRACE context identifier. More... | |
| void | SetTraceContextIdentifier (unsigned id) |
| void | GetTraceContextIdentifier (PObject &obj) |
| void | GetTraceContextIdentifier (PObject *obj) |
| void | SetTraceContextIdentifier (const PObject &obj) |
| void | SetTraceContextIdentifier (const PObject *obj) |
| virtual | ~PObject () |
| virtual PObject * | Clone () const |
| Create a copy of the class on the heap. More... | |
| template<class CLS > | |
| CLS * | CloneAs () const |
| As for Clone() but converts to specified type. More... | |
| virtual PINDEX | HashFunction () const |
This function yields a hash value required by the PDictionary class. More... | |
| virtual const char * | GetClass (unsigned ancestor=0) const |
| Get the current dynamic type of the object instance. More... | |
| PBoolean | IsClass (const char *cls) const |
| virtual PBoolean | InternalIsDescendant (const char *clsName) const |
| Determine if the dynamic type of the current instance is a descendent of the specified class. More... | |
| __inline const PObject * | PTraceObjectInstance () const |
| virtual Comparison | Compare (const PObject &obj) const |
| Compare the two objects and return their relative rank. More... | |
| virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
| Determine the byte wise comparison of two objects. More... | |
| bool | operator== (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator!= (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator< (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator> (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator<= (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator>= (const PObject &obj) const |
| Compare the two objects. More... | |
| virtual void | PrintOn (ostream &strm) const |
| Output the contents of the object to the stream. More... | |
| virtual void | ReadFrom (istream &strm) |
| Input the contents of the object from the stream. More... | |
Protected Attributes | |
| RecordSet & | m_recordSet |
| RowIndex | m_rowIndex |
| PArray< Field > | m_fields |
| Current row number, starting at 1, 0 == new. More... | |
Protected Attributes inherited from PObject | |
| unsigned | m_traceContextIdentifier |
Additional Inherited Members | |
Public Types inherited from PObject | |
| enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Result of the comparison operation performed by the Compare() function. More... | |
Static Public Member Functions inherited from PObject | |
| static const char * | Class () |
| Get the name of the class as a C string. More... | |
| static __inline const PObject * | PTraceObjectInstance (const char *) |
| static __inline const PObject * | PTraceObjectInstance (const PObject *obj) |
| static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size) |
| Internal function caled from CompareObjectMemoryDirect() More... | |
Protected Member Functions inherited from PObject | |
| PObject () | |
| Constructor for PObject, made protected so cannot ever create one on its own. More... | |
Friends inherited from PObject | |
Database Row Class This class functions as a simple wrapper of the Statement class to fetch/Save data to the Datasource.
Data is fetched on a need to basis and not cached except to create a new row.
| PODBC::Row::Row | ( | RecordSet & | recordSet | ) |
Constructor.
If rowIndex == 0, an empty record is used, otherwise that record number is fethed from back end.
| Field& PODBC::Row::Column | ( | PINDEX | column | ) | const |
Retrieve Field Data given the specifed column.
Note: Columns atart at 1 and not exceed Statement::GetColumnCount()
Referenced by PODBC::RecordSet::Column(), ColumnName(), ColumnPrecision(), ColumnScale(), ColumnSize(), ColumnType(), IsColumnAutoIndex(), IsColumnNullable(), IsColumnUpdatable(), and operator[]().
| PINDEX PODBC::Row::ColumnByName | ( | const PCaselessString & | columnName | ) | const |
ColumnByName returns the column number of the column name
If not found returns column value of 0;
|
inline |
References Columns().
|
inline |
Column Name.
References Column(), and PODBC::Field::GetName().
Referenced by PODBC::RecordSet::ColumnName().
| PStringArray PODBC::Row::ColumnNames | ( | ) | const |
Retrieve the Column Names.
Referenced by PODBC::RecordSet::ColumnNames().
|
inline |
ColumnPrecision Get the Number of Decimal places
if Precision is set the precision is set to the lessor of the Two.
References Column(), and PODBC::Field::GetPrecision().
|
inline |
Columns.
The Number of Columns in the RecordSet
References m_fields.
Referenced by ColumnCount(), and PODBC::RecordSet::Columns().
|
inline |
Column Scale.
References Column(), and PODBC::Field::GetScale().
|
inline |
Column Size.
References Column(), and PVarType::GetSize().
|
inline |
ColumnTypes.
References Column(), and PODBC::Field::GetDataType().
| bool PODBC::Row::Commit | ( | ) |
Post the Row back to the Database.
When Row::NewRow is true the data can be posted back to the Database; If Edit Invoked then releasea the RowHandler for Navigation.
Referenced by PODBC::RecordSet::Commit(), Post(), PODBC::RecordSet::Post(), PostNew(), and PostUpdate().
| bool PODBC::Row::First | ( | ) |
First record.
Referenced by PODBC::RecordSet::First().
|
inline |
References m_rowIndex.
|
inline |
IsColumnAutoIndex (ie don't give default Value)
References Column(), and PODBC::Field::IsAutoIndex().
|
inline |
|
inline |
IsColumn Updateable ie is not ReadOnly.
References Column(), and PODBC::Field::IsUpdatable().
| bool PODBC::Row::Last | ( | ) |
Last record.
Referenced by PODBC::RecordSet::Last().
| bool PODBC::Row::Move | ( | int | offset | ) |
Move to row relative to current position.
Referenced by PODBC::RecordSet::Move().
| bool PODBC::Row::MoveTo | ( | RowIndex | row | ) |
Move to Specified Row.
Referenced by PODBC::RecordSet::MoveTo(), and Navigate().
| bool PODBC::Row::Next | ( | ) |
Next record.
Referenced by PODBC::RecordSet::Next().
|
inline |
|
inline |
References Commit().
|
inline |
References Commit().
|
inline |
References Commit().
| bool PODBC::Row::Previous | ( | ) |
Previous record.
Referenced by PODBC::RecordSet::Previous().
| PINDEX PODBC::Row::Rows | ( | ) |
| void PODBC::Row::SetNewRow | ( | ) |
Make this row a new one.
Current row number, starting at 1, 0 == new.
Referenced by Columns().
|
protected |
|
protected |
Referenced by GetRowIndex().