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

DBOBJDefinitionNode Class Reference

#include <dbobjdefinition.hpp>

Inheritance diagram for DBOBJDefinitionNode:

Inheritance graph
[legend]
Collaboration diagram for DBOBJDefinitionNode:

Collaboration graph
[legend]
List of all members.

Detailed Description

This class represents the definition of a node.

Definition at line 377 of file dbobjdefinition.hpp.

Public Methods

 DBOBJDefinitionNode ()
 Constructor. Inits private data members.

 ~DBOBJDefinitionNode ()
 Destructor. Releases private data members.

const char * getName () const
 
Returns:
(string) Name of the node.


const char * getDBTable () const
 Returns the name of the table on which the node is mapped.

const char * getRestrict () const
 Returns the hardcoded restriction clause of the node.

const char * getCheckPre () const
 Returns the pre-save SQL order of the node.

const char * getCheckPost () const
 Returns the post-save SQL order of the node.

bool isLocked () const
 Returns wheteher the node is read-only or not.

bool isDistinct () const
 Returns wheteher the node is read-only or not.

DBOBJDefinitionNode * getParent () const
 Returns the parent node of the node.

void setName (const char *p_szName)
 Sets the name of the node.

void setDBtable (const char *p_szDBTable)
 Sets the table name on which the node is mapped.

void setRestrict (const char *p_szRestrict)
 Sets the node hardcoded restriction clause.

void setCheckPre (const char *p_szCheckPre)
 Sets node's pre-save SQL order.

void setCheckPost (const char *p_szCheckPost)
 Sets node's post-save SQL order.

void setLocked (bool p_boolLocked)
 Sets node's read only.

void setDistinct (bool p_boolDistinct)
 Sets node's read only.

void setParent (DBOBJDefinitionNode *p_pParentDefinition)
 Sets node's parent node definition .

const char * getOnDelete () const
const char * getOnInsert () const
const char * getOnUpdate () const
void setOnDelete (const char *p_pszOnDelete)
void setOnInsert (const char *p_pszOnInsert)
void setOnUpdate (const char *p_pszOnUpdate)
void addChild (DBOBJDefinitionNode *p_ChildDefinition)
 Appends a child node definition to the node.

void removeChild (unsigned int p_uiIndex, bool p_boolDestroy=true)
 Removes a child node definition from the node.

void removeChild (const char *p_szName, bool p_boolDestroy=true)
 Removes a child node definition from the node.

unsigned int getChildNodesCount () const
 Returns the number of child definition nodes.

DBOBJDefinitionNode * getChildNode (unsigned int p_uiIndex) const
 Returns a child node definition.

DBOBJDefinitionNode * getChildNode (const char *p_szName) const
 Returns a child node definition.

void addField (DBOBJDefinitionField *p_pFieldDefinition)
 Appends a field definition to the node.

void removeField (unsigned int p_uiIndex, bool p_boolDestroy=true)
 Removes a field definition from the node.

void removeField (const char *p_szName, bool p_boolDestroy=true)
 Removes a field definition from the node.

unsigned int getFieldsCount () const
 Returns the number of field definitions of the node.

DBOBJDefinitionFieldgetField (unsigned int p_uiIndex) const
 Returns a field definition.

DBOBJDefinitionFieldgetField (const char *p_szName) const
 Returns a field definition.

void addPkey (const char *p_szName)
 Appends a primary key to the node.

void remPkey (unsigned int p_index)
 Removes a primary key to the node.

unsigned int getPkeysCount () const
 Returns the number of primary keys.

DBOBJDefinitionFieldgetPkey (unsigned int p_uiIndex) const
 Returns a primary key field defintion.

DBOBJDefinitionFieldgetPkey (const char *p_pszName) const
 Returns a primary key field defintion.

void addKeyLink (const char *p_szLocalName, const char *p_szParentName)
 Appends a key link beetween this node and its parent.

void remKeyLink (unsigned int p_uiIndex)
 Removes a key link.

unsigned int getKeyLinksCount () const
 Returns the number of key links of the node.

DBOBJDefinitionFieldsPairgetKeyLink (unsigned int p_uiIndex) const
 Returns the pair of field definitions of a key link.

DBOBJDefinitionFieldsPairgetKeyLink (const char *p_pszName) const
 Returns the pair of field definitions of a key link.

void getXML (XMLStreamConsumer *p_pXMLBufOut)
 Outputs XML stream of the definition tree.


Constructor & Destructor Documentation

DBOBJDefinitionNode::DBOBJDefinitionNode  
 

Constructor. Inits private data members.

Definition at line 406 of file dbobjdefinition.cpp.

References DEBUG_CREATE, and importCharBuffer().

DBOBJDefinitionNode::~DBOBJDefinitionNode  
 

Destructor. Releases private data members.

Definition at line 427 of file dbobjdefinition.cpp.

References DEBUG_DEL, and releaseCharBuffer().


Member Function Documentation

void DBOBJDefinitionNode::addChild DBOBJDefinitionNode *    p_ChildDefinition
 

Appends a child node definition to the node.

Parameters:
p_ChildDefinition (DBOBJDefinitionNode*) Child node object to append.

Definition at line 660 of file dbobjdefinition.cpp.

References VAarray< DBOBJDefinitionNode * >::add(), DEBUG_FUNC, getName(), and setParent().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::addField DBOBJDefinitionField   p_pFieldDefinition
 

Appends a field definition to the node.

Parameters:
p_pFieldDefinition (DBOBJDefinitionField*) Field definition object to append.

Definition at line 738 of file dbobjdefinition.cpp.

References VAarray< DBOBJDefinitionField * >::add(), DEBUG_FUNC, DBOBJDefinitionField::getName(), and DBOBJDefinitionField::setParent().

Referenced by AutodescStreamer::completeDefinitionNode(), and SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::addKeyLink const char *    p_szLocalName,
const char *    p_szParentName
 

Appends a key link beetween this node and its parent.

Parameters:
p_szLocalName (string) Name of the field of this node used for the join.
p_szParentName (string) Name of the field of parent node used for the join.
Exceptions:
XMLFlowException ERRCODE_CAUSE_MISSINGREF

Definition at line 883 of file dbobjdefinition.cpp.

References VAarray< DBOBJDefinitionFieldsPair * >::add(), DEBUG_FUNC, _DBOBJDefinitionFieldsPair::first, getField(), getName(), getParent(), _DBOBJDefinitionFieldsPair::second, and THROW_XMLFLOW_EXCEPTION.

Referenced by SAXDBOBJDefinitionBuilder::endElement().

void DBOBJDefinitionNode::addPkey const char *    p_szName
 

Appends a primary key to the node.

Parameters:
p_szName (string) Name of the primary key field.
Exceptions:
XMLFlowException ERRCODE_CAUSE_MISSINGREF

Definition at line 819 of file dbobjdefinition.cpp.

References VAarray< DBOBJDefinitionField * >::add(), DEBUG_FUNC, getField(), getName(), DBOBJDefinitionField::setPkey(), and THROW_XMLFLOW_EXCEPTION.

Referenced by SAXDBOBJDefinitionBuilder::endElement().

const char * DBOBJDefinitionNode::getCheckPost   const
 

Returns the post-save SQL order of the node.

Returns:
(string) Post-save SQL order of the node.

Definition at line 488 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildCHECKStatement(), and getXML().

const char * DBOBJDefinitionNode::getCheckPre   const
 

Returns the pre-save SQL order of the node.

Returns:
(string) Pre-save SQL order of the node.

Definition at line 479 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildCHECKStatement(), and getXML().

DBOBJDefinitionNode * DBOBJDefinitionNode::getChildNode const char *    p_szName const
 

Returns a child node definition.

Parameters:
p_szName (string) Name of the node.
Returns:
(DBOBJDefinitionNode*) Child node definition requested.

Definition at line 727 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionNode * >::get().

DBOBJDefinitionNode * DBOBJDefinitionNode::getChildNode unsigned int    p_uiIndex const
 

Returns a child node definition.

Parameters:
p_index (int) Index of the node.
Returns:
(DBOBJDefinitionNode*) Child node definition requested.

Definition at line 718 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionNode * >::get().

Referenced by AutodescStreamer::completeDefinitionNode(), getXML(), DDLStreamer::makeNodeDDL(), DBOBJGetStatementSAXBuilder::startElement(), and DBObjectSAXBuilder::startElement().

unsigned int DBOBJDefinitionNode::getChildNodesCount   const
 

Returns the number of child definition nodes.

Returns:
(int) Number of child nodes.

Definition at line 709 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionNode * >::size().

Referenced by AutodescStreamer::completeDefinitionNode(), getXML(), and DDLStreamer::makeNodeDDL().

const char * DBOBJDefinitionNode::getDBTable   const
 

Returns the name of the table on which the node is mapped.

Returns:
(string) The name of the table on which is mapped the node.

Definition at line 461 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildDELETEStatement(), DBOBJSetStreamer::buildINSERTStatement(), DBOBJSetStreamer::buildUPDATEStatement(), AutodescStreamer::completeDefinitionNode(), getXML(), and DDLStreamer::makeNodeDDL().

DBOBJDefinitionField * DBOBJDefinitionNode::getField const char *    p_szName const
 

Returns a field definition.

Parameters:
p_szName (string) Name of the field to return.
Returns:
(DBOBJDefinitionField*) The requested field definition.

Definition at line 807 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::get().

DBOBJDefinitionField * DBOBJDefinitionNode::getField unsigned int    p_uiIndex const
 

Returns a field definition.

Parameters:
p_index (int) Index of the field to return.
Returns:
(DBOBJDefinitionField*) The requested field definition.

Definition at line 798 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::get().

Referenced by addKeyLink(), addPkey(), DBOBJSetStreamer::buildINSERTStatement(), DBOBJSetStreamer::buildUPDATEStatement(), AutodescStreamer::completeDefinitionNode(), getXML(), DDLStreamer::makeNodeDDL(), DBOBJGetStatementSAXBuilder::startElement(), and DBObjectSAXBuilder::startElement().

unsigned int DBOBJDefinitionNode::getFieldsCount   const
 

Returns the number of field definitions of the node.

Returns:
(int) The number of field definitions of the node.

Definition at line 789 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::size().

Referenced by DBOBJSetStreamer::buildINSERTStatement(), DBOBJSetStreamer::buildUPDATEStatement(), AutodescStreamer::completeDefinitionNode(), getXML(), and DDLStreamer::makeNodeDDL().

DBOBJDefinitionFieldsPair * DBOBJDefinitionNode::getKeyLink const char *    p_pszName const
 

Returns the pair of field definitions of a key link.

Parameters:
p_pszName (const char*) The name of the local key link field.
Returns:
The pair of field definitions of a key link.

Definition at line 941 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionFieldsPair * >::get().

DBOBJDefinitionFieldsPair * DBOBJDefinitionNode::getKeyLink unsigned int    p_uiIndex const
 

Returns the pair of field definitions of a key link.

Parameters:
p_index (int) The index of the key link.
Returns:
The pair of field definitions of a key link.

Definition at line 932 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionFieldsPair * >::get().

Referenced by getXML().

unsigned int DBOBJDefinitionNode::getKeyLinksCount   const
 

Returns the number of key links of the node.

Returns:
(int) The number of key links of the node.

Definition at line 923 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionFieldsPair * >::size().

Referenced by getXML().

const char * DBOBJDefinitionNode::getName   const
 

Returns:
(string) Name of the node.

Definition at line 452 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by addChild(), addKeyLink(), addPkey(), DBOBJGetStatementNode::DBOBJGetStatementNode(), SAXDBOBJDefinitionBuilder::endElement(), getXML(), DDLStreamer::makeNodeDDL(), DBObjectNode::setDefinition(), DBOBJGetStatementSAXBuilder::startElement(), and DBObjectSAXBuilder::startElement().

const char * DBOBJDefinitionNode::getOnDelete   const
 

Definition at line 602 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildDELETEStatement(), and getXML().

const char * DBOBJDefinitionNode::getOnInsert   const
 

Definition at line 611 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildINSERTStatement(), and getXML().

const char * DBOBJDefinitionNode::getOnUpdate   const
 

Definition at line 620 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by DBOBJSetStreamer::buildUPDATEStatement(), and getXML().

DBOBJDefinitionNode * DBOBJDefinitionNode::getParent   const
 

Returns the parent node of the node.

Returns:
(DBOBJDefinitionNode* ) Parent node of the node.

Definition at line 516 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by addKeyLink().

DBOBJDefinitionField * DBOBJDefinitionNode::getPkey const char *    p_pszName const
 

Returns a primary key field defintion.

Parameters:
p_pszName (const char*) Name of the primary key field.
Returns:
(DBOBJDefinitionField*) The primary key field requested.

Definition at line 871 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::get().

DBOBJDefinitionField * DBOBJDefinitionNode::getPkey unsigned int    p_uiIndex const
 

Returns a primary key field defintion.

Parameters:
p_index (int) Index of the primary key.
Returns:
(DBOBJDefinitionField*) The primary key field requested.

Definition at line 862 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::get().

Referenced by DBOBJSetStreamer::buildWHEREclause(), and getXML().

unsigned int DBOBJDefinitionNode::getPkeysCount   const
 

Returns the number of primary keys.

Returns:
(int) Number of primary keys.

Definition at line 853 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::size().

Referenced by DBOBJSetStreamer::buildWHEREclause(), and getXML().

const char * DBOBJDefinitionNode::getRestrict   const
 

Returns the hardcoded restriction clause of the node.

Returns:
(string) Hardcoded restriction clause of the node.

Definition at line 470 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and exportCharBuffer().

Referenced by getXML().

void DBOBJDefinitionNode::getXML XMLStreamConsumer   p_pXMLBufOut
 

Outputs XML stream of the definition tree.

Parameters:
p_pXMLBufOut (XMLStreamBuffer*) The buffer to ouput the XML stream in.

Definition at line 952 of file dbobjdefinition.cpp.

References correctAttrValue(), DBOBJDEFNODE_CHECKPOST, DBOBJDEFNODE_CHECKPRE, DBOBJDEFNODE_DISTINCT, DBOBJDEFNODE_INKEY, DBOBJDEFNODE_LOCK, DBOBJDEFNODE_NAME, DBOBJDEFNODE_ONDELETE, DBOBJDEFNODE_ONINSERT, DBOBJDEFNODE_ONUPDATE, DBOBJDEFNODE_OUTKEY, DBOBJDEFNODE_PKEY, DBOBJDEFNODE_RESTRICT, DBOBJDEFNODE_TABLE, DBOBJDEFNODE_TAGNAME, DEBUG_FUNC, _DBOBJDefinitionFieldsPair::first, getCheckPost(), getCheckPre(), getChildNode(), getChildNodesCount(), getDBTable(), getField(), getFieldsCount(), getKeyLink(), getKeyLinksCount(), DBOBJDefinitionField::getName(), getName(), getOnDelete(), getOnInsert(), getOnUpdate(), getPkey(), getPkeysCount(), getRestrict(), DBOBJDefinitionField::getXML(), isDistinct(), isLocked(), releaseCharBuffer(), REQ_FALSE, REQ_TRUE, and _DBOBJDefinitionFieldsPair::second.

Referenced by AutodescStreamer::commitStream().

bool DBOBJDefinitionNode::isDistinct   const
 

Returns wheteher the node is read-only or not.

Returns:
(bool) TRUE if the node is read only.

Definition at line 507 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by getXML().

bool DBOBJDefinitionNode::isLocked   const
 

Returns wheteher the node is read-only or not.

Returns:
(bool) TRUE if the node is read only.

Definition at line 497 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by AutodescStreamer::completeDefinitionNode(), getXML(), and DBOBJSetStreamer::processNode().

void DBOBJDefinitionNode::remKeyLink unsigned int    p_uiIndex
 

Removes a key link.

Parameters:
p_index (int) Index of the key link to remove.

Definition at line 913 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionFieldsPair * >::remove().

void DBOBJDefinitionNode::removeChild const char *    p_szName,
bool    p_boolDestroy = true
 

Removes a child node definition from the node.

Parameters:
p_szName (string) Name of the node to remove.
p_boolDestroy (boolean, optionnal) TRUE if the child node definition must be deleted when removed.

Definition at line 690 of file dbobjdefinition.cpp.

References DEBUG_FUNC, VAarray< DBOBJDefinitionNode * >::remove(), and setParent().

void DBOBJDefinitionNode::removeChild unsigned int    p_uiIndex,
bool    p_boolDestroy = true
 

Removes a child node definition from the node.

Parameters:
index (int) Index of the child node to remove.
p_boolDestroy (boolean, optionnal) TRUE if the child node definition must be deleted when removed.

Definition at line 671 of file dbobjdefinition.cpp.

References DEBUG_FUNC, VAarray< DBOBJDefinitionNode * >::remove(), and setParent().

void DBOBJDefinitionNode::removeField const char *    p_szName,
bool    p_boolDestroy = true
 

Removes a field definition from the node.

Parameters:
p_szName (string) Name of the field deefiniton to remove.
p_boolDestroy (boolean, optionnal) TRUE if the field definition must be deleted when removed.

Definition at line 762 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

void DBOBJDefinitionNode::removeField unsigned int    p_uiIndex,
bool    p_boolDestroy = true
 

Removes a field definition from the node.

Parameters:
index (int) Index of the field deefiniton to remove.
p_boolDestroy (boolean, optionnal) TRUE if the field definition must be deleted when removed.

Definition at line 749 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and VAarray< DBOBJDefinitionField * >::remove().

void DBOBJDefinitionNode::remPkey unsigned int    p_index
 

Removes a primary key to the node.

Parameters:
p_index (int) Index of the primary key to remove.

Definition at line 840 of file dbobjdefinition.cpp.

References DEBUG_FUNC, VAarray< DBOBJDefinitionField * >::remove(), and DBOBJDefinitionField::setPkey().

void DBOBJDefinitionNode::setCheckPost const char *    p_szCheckPost
 

Sets node's post-save SQL order.

Parameters:
p_szCheckPost (string) Post-save SQL order.

Definition at line 563 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setCheckPre const char *    p_szCheckPre
 

Sets node's pre-save SQL order.

Parameters:
p_szCheckPre (string) Pre-save SQL order.

Definition at line 554 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setDBtable const char *    p_szDBTable
 

Sets the table name on which the node is mapped.

Parameters:
p_szDBTable (string) Table Name.

Definition at line 536 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setDistinct bool    p_boolDistinct
 

Sets node's read only.

Parameters:
p_boolLocked (bool) TRUE to make the node read only.

Definition at line 581 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setLocked bool    p_boolLocked
 

Sets node's read only.

Parameters:
p_boolLocked (bool) TRUE to make the node read only.

Definition at line 572 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setName const char *    p_szName
 

Sets the name of the node.

Parameters:
p_szName (string) Name of the node.

Definition at line 527 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setOnDelete const char *    p_pszOnDelete
 

Definition at line 629 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setOnInsert const char *    p_pszOnInsert
 

Definition at line 638 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setOnUpdate const char *    p_pszOnUpdate
 

Definition at line 648 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().

void DBOBJDefinitionNode::setParent DBOBJDefinitionNode *    p_pParentDefinition
 

Sets node's parent node definition .

Parameters:
p_pParentDefinition (DBOBJDefinitionNode*) Node's parent definition node.

Definition at line 590 of file dbobjdefinition.cpp.

References DEBUG_FUNC.

Referenced by addChild(), and removeChild().

void DBOBJDefinitionNode::setRestrict const char *    p_szRestrict
 

Sets the node hardcoded restriction clause.

Parameters:
p_szRestrict (string) Hardcoded restriction clause.

Definition at line 545 of file dbobjdefinition.cpp.

References DEBUG_FUNC, and importCharBuffer().

Referenced by SAXDBOBJDefinitionBuilder::startElement().


The documentation for this class was generated from the following files:
Generated on Sat Oct 4 13:23:37 2003 for XDFLengine by doxygen1.3-rc2