Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Record::rColumn Class Reference

Buffer for a column in a record. More...

#include <Record.h>

Collaboration diagram for Record::rColumn:

Collaboration graph

[legend]
List of all members.

Public Methods

 rColumn (dbMeta::mColumn* pmCol)
 Build a coulmn object for this record and link it to the static description. More...

virtual ~rColumn ()
dbMeta::mColumngetMeta ()
 Get the shared static data for this column. More...

const nsAReadableString& getOld ()
 Accessor for the old column value. More...

const nsAReadableString& getNew ()
 Accessor for the new column value. More...

const nsAReadableString& getCurrent ()
 Accessor for the current column value. More...

const nsAReadableString& getError ()
 Accessor for the column error message, if one. More...

void setDefault ()
 before an insert columns are set to their defaul value in case no new value has been sent. More...

void putOld (const nsAReadableString& vOld)
 Record what is suppose to be in the database. More...

RecordgetSlave ()
 Accessor for a slave record if this column has one. More...

void putSlave (Record* pSlave)
 When a new slave is created, link it to it's master. More...

bool putNew (Template* pTemplate, const nsAReadableString& vNew)
 New value of field from user. More...

void putCurrent (const nsAReadableString& vCurrent)
 Set the current value. More...

void update ()
 Copy values from new to current after error checking is done. More...

void copyCurrent ()
 Copy current database value into new and old field. More...

void clearError ()
 Reset the error field. More...

void putError (const nsAReadableString& error)
 Append to the error message. More...


Public Attributes

dbMeta::mColumnm_pmCol
 Reference to the static data for this column. More...


Private Attributes

nsString m_vError
 Error message if data failed it's validation test. More...

nsString m_vOld
 Old data value, must match what is in database or multiple update error. More...

nsString m_vNew
 The data that will end up in the record if everything goes ok. More...

nsString m_vCurrent
 The current value of the database. More...

Recordm_pSlave
 If this column is a master, a reference to the slave record. More...


Detailed Description

Buffer for a column in a record.

Contains current, new, old and default values for the column. Validates data passed in and generates error messages if needed

Definition at line 132 of file Record.h.


Constructor & Destructor Documentation

Record::rColumn::rColumn ( dbMeta::mColumn * pmCol )
 

Build a coulmn object for this record and link it to the static description.

Parameters:
mCol   reference to the static data for this column

Definition at line 179 of file Record.cpp.

Record::rColumn::~rColumn ( ) [virtual]
 

Definition at line 185 of file Record.cpp.


Member Function Documentation

void Record::rColumn::clearError ( )
 

Reset the error field.

Definition at line 341 of file Record.cpp.

void Record::rColumn::copyCurrent ( )
 

Copy current database value into new and old field.

This is used before and update to make sure fields that were not specificied are not changed. If a field isn't specificed it's current value will be written back. This allows a single update statement to be cached.

Definition at line 332 of file Record.cpp.

const nsAReadableString & Record::rColumn::getCurrent ( )
 

Accessor for the current column value.

Definition at line 218 of file Record.cpp.

Referenced by Transaction::buildRecord(), and Report::buildRecord().

const nsAReadableString & Record::rColumn::getError ( )
 

Accessor for the column error message, if one.

Definition at line 226 of file Record.cpp.

Referenced by Transaction::buildRecord(), and Report::buildRecord().

dbMeta::mColumn * Record::rColumn::getMeta ( )
 

Get the shared static data for this column.

Definition at line 194 of file Record.cpp.

Referenced by Transaction::buildRecord(), and Report::buildRecord().

const nsAReadableString & Record::rColumn::getNew ( )
 

Accessor for the new column value.

Definition at line 210 of file Record.cpp.

const nsAReadableString & Record::rColumn::getOld ( )
 

Accessor for the old column value.

Definition at line 202 of file Record.cpp.

Record * Record::rColumn::getSlave ( )
 

Accessor for a slave record if this column has one.

Definition at line 257 of file Record.cpp.

Referenced by Transaction::buildRecord(), and Report::buildRecord().

void Record::rColumn::putCurrent ( const nsAReadableString & vCurrent )
 

Set the current value.

This field only comes from the database so it does not need to be validated

Parameters:
vCurrent  

Definition at line 312 of file Record.cpp.

void Record::rColumn::putError ( const nsAReadableString & error )
 

Append to the error message.

Parameters:
error   const nsAReadableString& to append

Definition at line 351 of file Record.cpp.

bool Record::rColumn::putNew ( Template * pTemplate,
const nsAReadableString & vNew )
 

New value of field from user.

This value must be typechecked and error can be generated. Dates are type checked via Java. this should be moved into the Javascript file

Parameters:
template   static page definition, holds point to datatype checking Javascript
cx   runtime context for evaulating Javascript
vNew   new data

Definition at line 282 of file Record.cpp.

Referenced by Transaction::validateFields(), and Report::validateFields().

void Record::rColumn::putOld ( const nsAReadableString & vOld )
 

Record what is suppose to be in the database.

Empty date const nsAReadableString&s are converted to null

Parameters:
vOld   expect column value

Definition at line 246 of file Record.cpp.

Referenced by Transaction::validateFields(), and Report::validateFields().

void Record::rColumn::putSlave ( Record * pSlave )
 

When a new slave is created, link it to it's master.

Parameters:
slave   new slave record

Definition at line 267 of file Record.cpp.

void Record::rColumn::setDefault ( )
 

before an insert columns are set to their defaul value in case no new value has been sent.

Definition at line 235 of file Record.cpp.

void Record::rColumn::update ( )
 

Copy values from new to current after error checking is done.

Current values are used when building XML

Definition at line 321 of file Record.cpp.


Member Data Documentation

Record * Record::rColumn::m_pSlave [private]
 

If this column is a master, a reference to the slave record.

Definition at line 158 of file Record.h.

dbMeta::mColumn * Record::rColumn::m_pmCol
 

Reference to the static data for this column.

Definition at line 137 of file Record.h.

nsString Record::rColumn::m_vCurrent [private]
 

The current value of the database.

Definition at line 154 of file Record.h.

nsString Record::rColumn::m_vError [private]
 

Error message if data failed it's validation test.

Definition at line 142 of file Record.h.

nsString Record::rColumn::m_vNew [private]
 

The data that will end up in the record if everything goes ok.

Definition at line 150 of file Record.h.

nsString Record::rColumn::m_vOld [private]
 

Old data value, must match what is in database or multiple update error.

Definition at line 146 of file Record.h.


The documentation for this class was generated from the following files:
Generated at Tue Sep 12 16:29:55 2000 by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000