/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
DbiTableMetaData Class Reference

#include <DbiTableMetaData.h>

Collaboration diagram for DbiTableMetaData:
Collaboration graph
[legend]

List of all members.

Classes

struct  ColumnAttributes
 Column attributes. More...

Public Member Functions

 DbiTableMetaData (const string &tableName="Unknown")
virtual ~DbiTableMetaData ()
string Sql (Dbi::DbTypes dbType=Dbi::kMySQL) const
 Return SQL string to create table.
string TableName () const
Bool_t HasRowCounter () const
UInt_t NumCols () const
const DbiFieldTypeColFieldType (Int_t colNum) const
UInt_t ColFieldConcept (Int_t colNum) const
Bool_t ColIsNullable (Int_t colNum) const
Bool_t ColMustDelimit (Int_t colNum) const
string ColName (Int_t colNum) const
void SetFromSql (const string &sql)
 Recreate from SQL used to create table.

Protected Member Functions

void Clear ()
void SetColIsNullable (Int_t colNum, Bool_t isNullable=true)
void SetColName (const string &name, Int_t colNum)
void SetColFieldType (const DbiFieldType &type, Int_t colNum)

Private Types

enum  { MAXCOL = 1000 }
 Sanity check: limit number of columns. More...

Private Member Functions

void ExpandTo (UInt_t colNum)
const ColumnAttributesGetAttributes (Int_t colNum) const
 Return a column attributes (will be dummy entry if requesting invalid column)
ColumnAttributesSetAttributes (Int_t colNum)
 Return a setable column attributes (will be dummy entry if requesting invalid column)

Static Private Member Functions

static string GetToken (const char *&strPtr)
 Use to parse table version SQL - move to UtilString?

Private Attributes

std::vector< ColumnAttributesfColAttr
 Column attributes indexed by column (starting from 0)
UInt_t fNumCols
 Number of columns.
string fTableName
 Table name (either XXX or XXXVld)

Static Private Attributes

static ColumnAttributes fgDummy
 Dummy attributes (used when requesting invalid column)

Friends

class DbiDBProxy

Detailed Description

Id:
DbiTableMetaData.h,v 1.16 2007/04/26 14:19:57 west Exp

Definition at line 35 of file DbiTableMetaData.h.


Member Enumeration Documentation

anonymous enum [private]

Sanity check: limit number of columns.

Enumerator:
MAXCOL 

Definition at line 84 of file DbiTableMetaData.h.

{ MAXCOL = 1000};

Constructor & Destructor Documentation

DbiTableMetaData::DbiTableMetaData ( const string &  tableName = "Unknown")
virtual DbiTableMetaData::~DbiTableMetaData ( ) [virtual]

Member Function Documentation

string DbiTableMetaData::Sql ( Dbi::DbTypes  dbType = Dbi::kMySQL) const

Return SQL string to create table.

string DbiTableMetaData::TableName ( ) const [inline]

Definition at line 51 of file DbiTableMetaData.h.

{ return fTableName; }
Bool_t DbiTableMetaData::HasRowCounter ( ) const [inline]

Definition at line 52 of file DbiTableMetaData.h.

{return  this->NumCols() >=2 && this->ColName(2) == "ROW_COUNTER"; }
UInt_t DbiTableMetaData::NumCols ( ) const [inline]

Definition at line 53 of file DbiTableMetaData.h.

{ return fNumCols;}
const DbiFieldType& DbiTableMetaData::ColFieldType ( Int_t  colNum) const [inline]

Definition at line 57 of file DbiTableMetaData.h.

{ return GetAttributes(colNum).Type;}
UInt_t DbiTableMetaData::ColFieldConcept ( Int_t  colNum) const [inline]

Definition at line 58 of file DbiTableMetaData.h.

{ return GetAttributes(colNum).Concept;} 
Bool_t DbiTableMetaData::ColIsNullable ( Int_t  colNum) const [inline]

Definition at line 59 of file DbiTableMetaData.h.

{ return GetAttributes(colNum).IsNullable;} 
Bool_t DbiTableMetaData::ColMustDelimit ( Int_t  colNum) const [inline]

Definition at line 60 of file DbiTableMetaData.h.

{ return GetAttributes(colNum).MustDelimit;} 
string DbiTableMetaData::ColName ( Int_t  colNum) const [inline]

Definition at line 61 of file DbiTableMetaData.h.

{ return GetAttributes(colNum).Name;} 
void DbiTableMetaData::SetFromSql ( const string &  sql)

Recreate from SQL used to create table.

void DbiTableMetaData::Clear ( ) [protected]
void DbiTableMetaData::SetColIsNullable ( Int_t  colNum,
Bool_t  isNullable = true 
) [inline, protected]

Definition at line 74 of file DbiTableMetaData.h.

{ SetAttributes(colNum).IsNullable = isNullable;}
void DbiTableMetaData::SetColName ( const string &  name,
Int_t  colNum 
) [inline, protected]

Definition at line 75 of file DbiTableMetaData.h.

{ SetAttributes(colNum).Name = name;}
void DbiTableMetaData::SetColFieldType ( const DbiFieldType type,
Int_t  colNum 
) [protected]
static string DbiTableMetaData::GetToken ( const char *&  strPtr) [static, private]

Use to parse table version SQL - move to UtilString?

void DbiTableMetaData::ExpandTo ( UInt_t  colNum) [private]
const ColumnAttributes& DbiTableMetaData::GetAttributes ( Int_t  colNum) const [private]

Return a column attributes (will be dummy entry if requesting invalid column)

ColumnAttributes& DbiTableMetaData::SetAttributes ( Int_t  colNum) [private]

Return a setable column attributes (will be dummy entry if requesting invalid column)


Friends And Related Function Documentation

friend class DbiDBProxy [friend]

Definition at line 38 of file DbiTableMetaData.h.


Member Data Documentation

Dummy attributes (used when requesting invalid column)

Definition at line 106 of file DbiTableMetaData.h.

Column attributes indexed by column (starting from 0)

Definition at line 118 of file DbiTableMetaData.h.

UInt_t DbiTableMetaData::fNumCols [private]

Number of columns.

Definition at line 121 of file DbiTableMetaData.h.

string DbiTableMetaData::fTableName [private]

Table name (either XXX or XXXVld)

Definition at line 124 of file DbiTableMetaData.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:56:45 for DatabaseInterface by doxygen 1.7.4