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

dbMeta Class Reference

#include <dbMeta.h>

Collaboration diagram for dbMeta:

Collaboration graph

[legend]
List of all members.

Public Types

typedef std::vector<mColumn*> vectorColumn
 vector holding defined mColumn objects for the template. More...

typedef std::vector<mParam*> vectorParam
 vector holding defined mParam objects for the template. More...

typedef std::vector<dbMeta*> vectorMeta
 used for holding nested MASTER definitions. More...

enum  {
  NONE,
  COLUMN,
  SLAVE,
  ATTRIBUTE
}
 Column type NONE: unasigned Column type COLUMN: standard column mapped into an element Column type SLAVE: Controlling column for a slave record Column type ATTRIBUTE: Column being mapped into an attribute. More...


Public Methods

virtual ~dbMeta ()
 Description. More...

void buildMaster (Template* pTemplate, DOM_Element master)
 Description. More...

void buildPassThrough (Template* pTemplate, DOM_Element pt)
 Description. More...

const nsAReadableString& getName ()
 Column name as specificed with AS else dbname. More...

int size ()
 Description. More...

const nsAReadableString& getSeekKey (char op, const nsAReadableString& oldKey)
 Given a unique key, seek to a base table record. More...

const nsAReadableString& getSelect ()
 Build a SQL SELECT statement based on the template file. More...

const nsAReadableString& getUpdate ()
 Build a SQL UPDATE statement based on the template file. More...

const nsAReadableString& getInsert ()
 Build a SQL INSERT statement based on the template file. More...

const nsAReadableString& getDelete ()
 Build a SQL DELETE statement based on the template file. More...

mColumngetIdCol ()
 Return column description for the id column of the base table. More...

mColumngetMaster ()
 Slave record return column in master record, master record returns null. More...

bool isSlave ()
 is this a slave record? More...

void setMaster (mColumn* pMaster)
 When constructing a slave, remember the master. More...

void setIdCol (mColumn* pIdCol)
const nsAReadableString& getType ()
 Type specified in template, triggers type checking code, passed to XSL phase. More...


Public Attributes

friend mColumn
vectorColumn m_columns
vectorParam m_params
vectorMeta m_section

Static Public Methods

dbMeta* buildMeta (Template* pTemplate, DOM_Element top)
 Description. More...


Protected Methods

 dbMeta ()
 Static meta data for a database page. More...


Private Types

typedef std::map<const nsAReadableString*,
mColumn*, compareARS
mapStringColumn
 hash of columns based on column name. More...


Private Methods

mParamaddParam (const nsAReadableString& name, int number)
 Description. More...

mColumnaddColumn (Template* pTemplate, DOM_Element element, int kind, const nsAReadableString& correlate, bool base)
 Description. More...

mColumngetColumn (int col)
 Description. More...

mColumngetColumn (const nsAReadableString& name)
 Description. More...

mColumngetColumnDB (const nsAReadableString& name)
 Description. More...


Private Attributes

nsString m_name
 Element name for the record. More...

nsString m_type
 Type for the entire record. More...

nsString m_insert
 SQL const nsAReadableString& for INSERT constructed from the template. More...

nsString m_select
 SQL const nsAReadableString& for SELECT constructed from the template. More...

nsString m_update
 SQL const nsAReadableString& for UPDATE constructed from the template. More...

nsString m_delete
 SQL const nsAReadableString& for DELETE constructed from the template. More...

nsString m_base_table
 The base (updatable) table of the query. More...

nsString m_from
 SQL FROM clause applied to all SQL statements. More...

nsString m_where
 SQL WHERE clause applied to all SQL statements. More...

nsString m_order
 SQL ORDER BY clause applied to all SQL statements. More...

nsString m_group
 SQL GROUP BY clause applied to all SQL statements. More...

mColumnm_pIdCol
 reference to the primary key column for the record. More...

mColumnm_pMaster
 used by a slave record to back reference to it's master. More...

mapStringColumn m_hColumns

Member Typedef Documentation

typedef std::map<const nsAReadableString*, mColumn*, compareARS> dbMeta::mapStringColumn [private]
 

hash of columns based on column name.

Definition at line 109 of file dbMeta.h.

typedef std::vector<mColumn*> dbMeta::vectorColumn
 

vector holding defined mColumn objects for the template.

Definition at line 85 of file dbMeta.h.

typedef std::vector<dbMeta*> dbMeta::vectorMeta
 

used for holding nested MASTER definitions.

Definition at line 95 of file dbMeta.h.

typedef std::vector<mParam*> dbMeta::vectorParam
 

vector holding defined mParam objects for the template.

Definition at line 90 of file dbMeta.h.


Member Enumeration Documentation

anonymous enum
 

Column type NONE: unasigned Column type COLUMN: standard column mapped into an element Column type SLAVE: Controlling column for a slave record Column type ATTRIBUTE: Column being mapped into an attribute.

Enumeration values:
NONE  
COLUMN  
SLAVE  
ATTRIBUTE  

Definition at line 34 of file dbMeta.h.


Constructor & Destructor Documentation

dbMeta::dbMeta ( ) [protected]
 

Static meta data for a database page.

Compiles XML into an in memory data structure. Build SELECT, UPDATE, DELETE, INSERT statements for base table.

Definition at line 21 of file dbMeta.cpp.

Referenced by buildMaster(), and buildMeta().

dbMeta::~dbMeta ( ) [virtual]
 

Description.

Parameters:
template  
top  

Definition at line 26 of file dbMeta.cpp.


Member Function Documentation

mColumn * dbMeta::addColumn ( Template * pTemplate,
DOM_Element element,
int kind,
const nsAReadableString & correlate,
bool base ) [private]
 

Description.

Parameters:
template  
element  
kind  
correlate  
base  

Definition at line 235 of file dbMeta.cpp.

Referenced by buildMaster(), and buildPassThrough().

mParam * dbMeta::addParam ( const nsAReadableString & name,
int number ) [private]
 

Description.

Parameters:
name  
number  

Definition at line 219 of file dbMeta.cpp.

Referenced by buildMaster(), and buildPassThrough().

void dbMeta::buildMaster ( Template * pTemplate,
DOM_Element master )
 

Description.

Parameters:
template  
master  

Definition at line 61 of file dbMeta.cpp.

Referenced by buildMeta().

dbMeta * dbMeta::buildMeta ( Template * pTemplate,
DOM_Element top ) [static]
 

Description.

Parameters:
template  
top  

Definition at line 41 of file dbMeta.cpp.

Referenced by buildMaster(), Transaction::compile(), and Report::compile().

void dbMeta::buildPassThrough ( Template * pTemplate,
DOM_Element pt )
 

Description.

Parameters:
template  
pt  

Definition at line 174 of file dbMeta.cpp.

Referenced by buildMeta().

mColumn * dbMeta::getColumn ( const nsAReadableString & name ) [private]
 

Description.

Parameters:
name  

Definition at line 292 of file dbMeta.cpp.

mColumn * dbMeta::getColumn ( int col ) [private]
 

Description.

Parameters:
col  

Definition at line 281 of file dbMeta.cpp.

mColumn * dbMeta::getColumnDB ( const nsAReadableString & name ) [private]
 

Description.

Parameters:
name  

Definition at line 307 of file dbMeta.cpp.

const nsAReadableString & dbMeta::getDelete ( )
 

Build a SQL DELETE statement based on the template file.

Definition at line 462 of file dbMeta.cpp.

Referenced by Transaction::doDelete().

mColumn * dbMeta::getIdCol ( )
 

Return column description for the id column of the base table.

Definition at line 478 of file dbMeta.cpp.

Referenced by getDelete(), and getUpdate().

const nsAReadableString & dbMeta::getInsert ( )
 

Build a SQL INSERT statement based on the template file.

Definition at line 423 of file dbMeta.cpp.

Referenced by Transaction::doInsert().

mColumn * dbMeta::getMaster ( )
 

Slave record return column in master record, master record returns null.

Definition at line 486 of file dbMeta.cpp.

const nsAReadableString & dbMeta::getName ( )
 

Column name as specificed with AS else dbname.

Definition at line 520 of file dbMeta.cpp.

Referenced by Transaction::buildDocument(), Transaction::buildXML(), and Report::buildXML().

const nsAReadableString & dbMeta::getSeekKey ( char op,
const nsAReadableString & oldKey )
 

Given a unique key, seek to a base table record.

Parameters:
op   one of F)irst, P)rev, Nex)t, L)ast
oldKey   starting postion

Definition at line 331 of file dbMeta.cpp.

Referenced by Transaction::aSeek().

const nsAReadableString & dbMeta::getSelect ( )
 

Build a SQL SELECT statement based on the template file.

Definition at line 355 of file dbMeta.cpp.

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

const nsAReadableString & dbMeta::getType ( )
 

Type specified in template, triggers type checking code, passed to XSL phase.

Definition at line 528 of file dbMeta.cpp.

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

const nsAReadableString & dbMeta::getUpdate ( )
 

Build a SQL UPDATE statement based on the template file.

Definition at line 393 of file dbMeta.cpp.

Referenced by Transaction::doUpdate().

bool dbMeta::isSlave ( )
 

is this a slave record?

Definition at line 494 of file dbMeta.cpp.

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

void dbMeta::setIdCol ( mColumn * pIdCol )
 

Parameters:
master  

Definition at line 512 of file dbMeta.cpp.

Referenced by dbMeta::mColumn::putType().

void dbMeta::setMaster ( mColumn * pMaster )
 

When constructing a slave, remember the master.

Parameters:
master  

Definition at line 504 of file dbMeta.cpp.

Referenced by dbMeta::mColumn::putSlave().

int dbMeta::size ( )
 

Description.

Definition at line 320 of file dbMeta.cpp.


Member Data Documentation

mColumn
 

Definition at line 26 of file dbMeta.h.

Referenced by addColumn().

nsString dbMeta::m_base_table [private]
 

The base (updatable) table of the query.

Definition at line 64 of file dbMeta.h.

vectorColumn dbMeta::m_columns
 

Definition at line 86 of file dbMeta.h.

nsString dbMeta::m_delete [private]
 

SQL const nsAReadableString& for DELETE constructed from the template.

Definition at line 60 of file dbMeta.h.

nsString dbMeta::m_from [private]
 

SQL FROM clause applied to all SQL statements.

Definition at line 68 of file dbMeta.h.

nsString dbMeta::m_group [private]
 

SQL GROUP BY clause applied to all SQL statements.

Definition at line 80 of file dbMeta.h.

mapStringColumn dbMeta::m_hColumns [private]
 

Definition at line 110 of file dbMeta.h.

nsString dbMeta::m_insert [private]
 

SQL const nsAReadableString& for INSERT constructed from the template.

Definition at line 48 of file dbMeta.h.

nsString dbMeta::m_name [private]
 

Element name for the record.

Definition at line 40 of file dbMeta.h.

nsString dbMeta::m_order [private]
 

SQL ORDER BY clause applied to all SQL statements.

Definition at line 76 of file dbMeta.h.

mColumn * dbMeta::m_pIdCol [private]
 

reference to the primary key column for the record.

Definition at line 101 of file dbMeta.h.

mColumn * dbMeta::m_pMaster [private]
 

used by a slave record to back reference to it's master.

Definition at line 105 of file dbMeta.h.

vectorParam dbMeta::m_params
 

Definition at line 91 of file dbMeta.h.

vectorMeta dbMeta::m_section
 

Definition at line 96 of file dbMeta.h.

nsString dbMeta::m_select [private]
 

SQL const nsAReadableString& for SELECT constructed from the template.

Definition at line 52 of file dbMeta.h.

nsString dbMeta::m_type [private]
 

Type for the entire record.

Definition at line 44 of file dbMeta.h.

nsString dbMeta::m_update [private]
 

SQL const nsAReadableString& for UPDATE constructed from the template.

Definition at line 56 of file dbMeta.h.

nsString dbMeta::m_where [private]
 

SQL WHERE clause applied to all SQL statements.

Definition at line 72 of file dbMeta.h.


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