PACK WOC  $VERSION$
Classes | Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
WocTable Class Reference

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

#include <proctable.h>

Classes

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

Public Member Functions

 WocTable ()
 initializes an invalid table More...
 
 WocTable (const QDomElement &)
 initializes a table from XML More...
 
bool isValid () const
 returns whether this instance is valid, ie. More...
 
QString name () const
 returns the table name More...
 
QString baseClass () const
 returns the parent class of the table class - default: WobTable More...
 
bool inBackup () const
 returns whether the table is marked for backup More...
 
QString backupKey () const
 returns which column the table uses for backup grouping More...
 
int backupGroupSize () const
 returns the default group size for backup or <=0 if default is to be used More...
 
bool hasColumn (QString) const
 returns whether the table has a column with this name More...
 
QStringList columns () const
 returns a list of all defined column names More...
 
QStringList primaryColumns () const
 returns the list of all primary key columns More...
 
QString columnType (QString) const
 returns the data type of the column More...
 
bool columnIsNull (QString) const
 returns whether the column allows NULLs More...
 
bool columnIsPrimary (QString) const
 returns whether the column is part of the primary key More...
 
bool columnHasDefault (QString) const
 returns whether the column has a default More...
 
QString columnDefault (QString) const
 returns the default value of the column (empty string if there is none) More...
 
bool columnIsForeign (QString) const
 returns whether the column is a foreign key More...
 
QString columnForeign (QString) const
 returns the foreign key reference of the column in the format table:column More...
 
bool columnIsIndexed (QString) const
 returns whether the column has an index More...
 
bool columnIsUnique (QString) const
 returns whether the column has a unique constraint More...
 
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 More...
 
QString columnCall (QString col, QString lang) const
 returns the insert call of a column for a specific language; empty string if there is none More...
 
QList< WocEnumgetEnums () const
 returns all enum definitions of the table; see also columnEnums More...
 
QStringList foreigns () const
 returns a list of all foreign definitions - methods that return data from other tables More...
 
QString foreignQuery (QString) const
 returns the definition of a specific foreign table query method More...
 
bool haveForeign (QString) const
 returns whether a foreign table query method exists More...
 
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 More...
 
bool isAuditable () const
 returns whether the table is auditable More...
 
WocTable auditTable () const
 creates and returns the table instance that represents the audit table More...
 
QStringList auditColumns () const
 returns the names of audit columns (except auditid) More...
 
QStringList uniqueConstraints () const
 returns all complex Unique constraints (those not defined for a single column) More...
 
QStringList docStrings () const
 returns table documentation More...
 
QString columnDoc (QString c) const
 returns column documentation More...
 
QString foreignDoc (QString c) const
 returns foreign getter documentation More...
 

Static Public Member Functions

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

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
 
QString m_backupkey
 
QList< s_colm_columns
 
QList< s_colm_auditcolumns
 
QList< QPair< QString, QString > > m_foreign
 
QList< QMap< QString, QString > > m_presets
 
int m_backupsize =-1
 
QStringList m_docstrings
 
QStringList m_uniquecols
 
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

int WocTable::backupGroupSize ( ) const
inline

returns the default group size for backup or <=0 if default is to be used

QString WocTable::backupKey ( ) const
inline

returns which column the table uses for backup grouping

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 
)
staticprivate
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

QStringList WocTable::uniqueConstraints ( ) const
inline

returns all complex Unique constraints (those not defined for a single column)

Member Data Documentation

bool WocTable::m_audit
private
QList<s_col> WocTable::m_auditcolumns
private
bool WocTable::m_backup
private
QString WocTable::m_backupkey
private
int WocTable::m_backupsize =-1
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
staticprivate
QStringList WocTable::m_uniquecols
private
bool WocTable::m_valid
private

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