Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

DOSnapshot Class Reference

Adds insert and update capabilities to a DOQuery corresponding to a table. More...

#include <Snapshot.h>

Inheritance diagram for DOSnapshot:

DOQuery List of all members.

Public Methods

 DOSnapshot (DOConnection *pConnection, const char *tableName)
 Constructor method. More...

virtual ~DOSnapshot ()
 Destructor method. More...

void AddNew ()
 Initiate adding a new record (row) to a table. More...

void CommitAdd (bool refresh=true, bool delayedAllowed=true)
 Sends the record to the database server as an INSERT INTO SQL statement.
m refresh if true the table will be re-read. @parm delayedAllowed if refresh==false "insert delayed into" will be used unless this is set to false as
well.
More...


void CommitEdit (bool refresh=true)
 Sends the record to the database server as an UPDATE SET WHERE SQL statement. More...

void Edit ()
 Initiate editting a record (row) in a table. More...

void Let (const char *fldName, const char *value)
 Set a field value by name. More...

void Let (const unsigned int fldNum, const char *value)
 Set a field value by field number. More...

void Let (const char *fldName, int value)
 Set a field value by name. More...

void Let (const unsigned int fldNum, int value)
 Set a field value by field number. More...


Public Attributes

int m_LastInsertId

Private Methods

void ConstructorInclude ()
 Method which must be called first in a constructor. More...

void DestructorInclude ()
 Method which must be called first in a destructor. More...


Private Attributes

CString** m_pNewData

Detailed Description

Adds insert and update capabilities to a DOQuery corresponding to a table.

Definition at line 79 of file Snapshot.h.


Constructor & Destructor Documentation

DOSnapshot::DOSnapshot ( DOConnection * pConnection,
const char * tableName )
 

Constructor method.

Definition at line 103 of file Snapshot.cpp.

DOSnapshot::~DOSnapshot ( ) [virtual]
 

Destructor method.

Definition at line 120 of file Snapshot.cpp.


Member Function Documentation

void DOSnapshot::AddNew ( )
 

Initiate adding a new record (row) to a table.

Resets all the fields to NIL. Use Let() to set the values, then issue CommitAdd() to actually insert the record into the table.

Definition at line 142 of file Snapshot.cpp.

Referenced by IRPlus::InsertIRFieldRecord().

void DOSnapshot::CommitAdd ( bool refresh = true,
bool delayedAllowed = true )
 

Sends the record to the database server as an INSERT INTO SQL statement.

m refresh if true the table will be re-read. @parm delayedAllowed if refresh==false "insert delayed into" will be used unless this is set to false as
well.

Todo:
some error reporting perhaps?

Definition at line 165 of file Snapshot.cpp.

Referenced by IRPlus::InsertIRFieldRecord().

void DOSnapshot::CommitEdit ( bool refresh = true )
 

Sends the record to the database server as an UPDATE SET WHERE SQL statement.

If the table has a primary key, all its fields will be used to build a WHERE clause. Otherwise, the update will only be done if the table has only 1 row.

  • refresh if true the table will be re-read.
Todo:
some error reporting perhaps?

Definition at line 219 of file Snapshot.cpp.

void DOSnapshot::ConstructorInclude ( ) [private]
 

Method which must be called first in a constructor.

Definition at line 358 of file Snapshot.cpp.

void DOSnapshot::DestructorInclude ( ) [private]
 

Method which must be called first in a destructor.

Reimplemented from DOQuery.

Definition at line 366 of file Snapshot.cpp.

Referenced by ~DOSnapshot().

void DOSnapshot::Edit ( )
 

Initiate editting a record (row) in a table.

Copies all the values from the current row. Use Let() to change the values, then issue CommitEdit() to actually update the record in the table.

Definition at line 279 of file Snapshot.cpp.

void DOSnapshot::Let ( const unsigned int fldNum,
int value )
 

Set a field value by field number.

Definition at line 345 of file Snapshot.cpp.

void DOSnapshot::Let ( const char * fldName,
int value )
 

Set a field value by name.

Definition at line 334 of file Snapshot.cpp.

void DOSnapshot::Let ( const unsigned int fldNum,
const char * value )
 

Set a field value by field number.

Definition at line 317 of file Snapshot.cpp.

void DOSnapshot::Let ( const char * fldName,
const char * value )
 

Set a field value by name.

Definition at line 308 of file Snapshot.cpp.

Referenced by IRPlus::InsertIRFieldRecord(), and Let().


Member Data Documentation

int DOSnapshot::m_LastInsertId
 

Definition at line 93 of file Snapshot.h.

CString ** DOSnapshot::m_pNewData [private]
 

Definition at line 88 of file Snapshot.h.


The documentation for this class was generated from the following files:
This documentation is part of the "SOAP to CORBA bridge" project
Copyright © 2000 by Lifeline Networks bv.
All rights are reserved.