Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes

WocTable Class Reference

stores the internal representation of a database table and its abstraction class More...

#include <proctable.h>

List of all members.

Classes

struct  s_col
 holds data for a DB table column More...

Public Member Functions

 WocTable ()
 initializes an invalid table
 WocTable (const QDomElement &)
 initializes a table from XML
bool isValid () const
 returns whether this instance is valid, ie.
QString name () const
 returns the table name
bool inBackup () const
 returns whether the table is marked for backup
QString baseClass () const
 returns the parent class of the table class - default: WobTable
bool hasColumn (QString) const
 returns whether the table has a column with this name
QStringList columns () const
 returns a list of all defined column names
QStringList primaryColumns () const
 returns the list of all primary key columns
QString columnType (QString) const
 returns the data type of the column
bool columnIsNull (QString) const
 returns whether the column allows NULLs
bool columnIsPrimary (QString) const
 returns whether the column is part of the primary key
bool columnHasDefault (QString) const
 returns whether the column has a default
QString columnDefault (QString) const
 returns the default value of the column (empty string if there is none)
bool columnIsForeign (QString) const
 returns whether the column is a foreign key
QString columnForeign (QString) const
 returns the foreign key reference of the column in the format table:column
bool columnIsIndexed (QString) const
 returns whether the column has an index
bool columnIsUnique (QString) const
 returns whether the column has a unique constraint
QList< WocEnumcolumnEnums (QString) const
 returns enum definitions of the column - each pair contains the symbolic name in first and the assigned integer value in second
QString columnCall (QString col, QString lang) const
 returns the insert call of a column for a specific language; empty string if there is none
QList< WocEnumgetEnums () const
 returns all enum definitions of the table; see also columnEnums
QStringList foreigns () const
 returns a list of all foreign definitions - methods that return data from other tables
QString foreignQuery (QString) const
 returns the definition of a specific foreign table query method
bool haveForeign (QString) const
 returns whether a foreign table query method exists
QList< QMap< QString, QString > > presets () const
 returns a list of all preset values (to be generated when the DB is created); each entry in the list is a dictionary with the column name as key and the intended preset value as value - each entry of the list is one DB row, each key-value-pair in the map is one preset value in that row
bool isAuditable () const
 returns whether the table is auditable
WocTable auditTable () const
 creates and returns the table instance that represents the audit table
QStringList auditColumns () const
 returns the names of audit columns (except auditid)
QStringList docStrings () const
 returns table documentation
QString columnDoc (QString c) const
 returns column documentation
QString foreignDoc (QString c) const
 returns foreign getter documentation

Static Public Member Functions

static void parseAuditStatic (const QDomElement &)
 parses the static part of auditing

Static Private Member Functions

static QPair< bool, s_colparseColumn (const QDomElement &, QString)

Private Attributes

bool m_valid
bool m_backup
bool m_audit
QString m_name
QString m_base
QList< s_colm_columns
QList< s_colm_auditcolumns
QList< QPair< QString, QString > > m_foreign
QList< QMap< QString, QString > > m_presets
QStringList m_docstrings
QMap< QString, QString > m_fordocs

Static Private Attributes

static QList< s_colm_staticauditcolumns

Detailed Description

stores the internal representation of a database table and its abstraction class


Constructor & Destructor Documentation

WocTable::WocTable (  ) 

initializes an invalid table

WocTable::WocTable ( const QDomElement &  tbl  ) 

initializes a table from XML


Member Function Documentation

QStringList WocTable::auditColumns (  )  const

returns the names of audit columns (except auditid)

WocTable WocTable::auditTable (  )  const

creates and returns the table instance that represents the audit table

QString WocTable::baseClass (  )  const [inline]

returns the parent class of the table class - default: WobTable

QString WocTable::columnCall ( QString  col,
QString  lang 
) const

returns the insert call of a column for a specific language; empty string if there is none

QString WocTable::columnDefault ( QString  c  )  const

returns the default value of the column (empty string if there is none)

QString WocTable::columnDoc ( QString  c  )  const

returns column documentation

QList< WocEnum > WocTable::columnEnums ( QString  c  )  const

returns enum definitions of the column - each pair contains the symbolic name in first and the assigned integer value in second

QString WocTable::columnForeign ( QString  c  )  const

returns the foreign key reference of the column in the format table:column

bool WocTable::columnHasDefault ( QString  c  )  const

returns whether the column has a default

bool WocTable::columnIsForeign ( QString  c  )  const

returns whether the column is a foreign key

bool WocTable::columnIsIndexed ( QString  c  )  const

returns whether the column has an index

bool WocTable::columnIsNull ( QString  c  )  const

returns whether the column allows NULLs

bool WocTable::columnIsPrimary ( QString  c  )  const

returns whether the column is part of the primary key

bool WocTable::columnIsUnique ( QString  c  )  const

returns whether the column has a unique constraint

QStringList WocTable::columns (  )  const

returns a list of all defined column names

QString WocTable::columnType ( QString  c  )  const

returns the data type of the column

QStringList WocTable::docStrings (  )  const [inline]

returns table documentation

QString WocTable::foreignDoc ( QString  c  )  const [inline]

returns foreign getter documentation

QString WocTable::foreignQuery ( QString  f  )  const

returns the definition of a specific foreign table query method

QStringList WocTable::foreigns (  )  const

returns a list of all foreign definitions - methods that return data from other tables

QList< WocEnum > WocTable::getEnums (  )  const

returns all enum definitions of the table; see also columnEnums

bool WocTable::hasColumn ( QString  c  )  const

returns whether the table has a column with this name

bool WocTable::haveForeign ( QString  f  )  const

returns whether a foreign table query method exists

bool WocTable::inBackup (  )  const [inline]

returns whether the table is marked for backup

bool WocTable::isAuditable (  )  const [inline]

returns whether the table is auditable

bool WocTable::isValid (  )  const [inline]

returns whether this instance is valid, ie.

whether parsing was successful

QString WocTable::name (  )  const [inline]

returns the table name

void WocTable::parseAuditStatic ( const QDomElement &  el  )  [static]

parses the static part of auditing

QPair< bool, WocTable::s_col > WocTable::parseColumn ( const QDomElement &  el,
QString  m_name 
) [static, private]
QList<QMap<QString,QString> > WocTable::presets (  )  const [inline]

returns a list of all preset values (to be generated when the DB is created); each entry in the list is a dictionary with the column name as key and the intended preset value as value - each entry of the list is one DB row, each key-value-pair in the map is one preset value in that row

QStringList WocTable::primaryColumns (  )  const

returns the list of all primary key columns


Member Data Documentation

bool WocTable::m_audit [private]
QList<s_col> WocTable::m_auditcolumns [private]
bool WocTable::m_backup [private]
QString WocTable::m_base [private]
QList<s_col> WocTable::m_columns [private]
QStringList WocTable::m_docstrings [private]
QMap<QString,QString> WocTable::m_fordocs [private]
QList<QPair<QString,QString> > WocTable::m_foreign [private]
QString WocTable::m_name [private]
QList<QMap<QString,QString> > WocTable::m_presets [private]
QList< WocTable::s_col > WocTable::m_staticauditcolumns [static, private]
bool WocTable::m_valid [private]

The documentation for this class was generated from the following files: