Kexi API Documentation (2.0 alpha)

KexiDB::QueryAsterisk Class Reference

#include <queryschema.h>

Inheritance diagram for KexiDB::QueryAsterisk:

KexiDB::Field List of all members.

Detailed Description

KexiDB::QueryAsterisk class encapsulates information about single asterisk in query definition.

There are two types of query asterisks:

1. "Single-table" asterisk, that references all fields of given table used in the query. Example SQL statement:

 SELECT staff.*, cars.model from staff, cars WHERE staff.car = cars.number;
The "staff.*" element is our "single-table" asterisk; this tells us that we want to get all fields of table "staff".

2. "All-tables" asterisk, that references all fields of all tables used in the query. Example SQL statement:

 SELECT * from staff, cars WHERE staff.car = cars.number;
The "*" is our "all-tables" asterisk; this tells us that we want to get all fields of all used tables (here: "staff" and "cars").

There can be many asterisks of 1st type defined for given single query. There can be one asterisk of 2nd type defined for given single query.

Definition at line 770 of file queryschema.h.

Public Member Functions

 QueryAsterisk (QuerySchema *query, TableSchema *table=0)
virtual ~QueryAsterisk ()
QuerySchemaquery () const
virtual TableSchematable () const
virtual void setTable (TableSchema *table)
bool isSingleTableAsterisk () const
bool isAllTableAsterisk () const
virtual QString debugString ()

Protected Attributes

TableSchemam_table

Friends

class QuerySchema


Constructor & Destructor Documentation

QueryAsterisk::QueryAsterisk QuerySchema query,
TableSchema table = 0
 

Constructs query asterisk definition object. Pass table schema to table if this asterisk should be of type "single-table", otherwise (if you want to define "all-tables" type asterisk), omit this parameter.

QueryAsterisk objects are owned by QuerySchema object (not by TableSchema object like for ordinary Field objects) for that the QueryAsterisk object was added (using QuerySchema::addField()).

Definition at line 1598 of file queryschema.cpp.

References KexiDB::Field::Asterisk, KexiDB::Field::m_parent, and KexiDB::Field::setType().

QueryAsterisk::~QueryAsterisk  )  [virtual]
 

Definition at line 1607 of file queryschema.cpp.


Member Function Documentation

QString QueryAsterisk::debugString  )  [virtual]
 

Returns:
String for debugging purposes.

Definition at line 1617 of file queryschema.cpp.

References isAllTableAsterisk(), KexiDB::SchemaData::name(), query(), and table().

bool KexiDB::QueryAsterisk::isAllTableAsterisk  )  const [inline]
 

This is convenience method that returns true if the asterisk has "single-tables" type (2nd type).

Definition at line 804 of file queryschema.h.

Referenced by debugString().

bool KexiDB::QueryAsterisk::isSingleTableAsterisk  )  const [inline]
 

This is convenience method that returns true if the asterisk has "all-tables" type (2nd type).

Definition at line 800 of file queryschema.h.

QuerySchema* KexiDB::QueryAsterisk::query  )  const [inline]
 

Returns:
Query object for that this asterisk object is defined

Reimplemented from KexiDB::Field.

Definition at line 787 of file queryschema.h.

Referenced by debugString().

void QueryAsterisk::setTable TableSchema table  )  [virtual]
 

Sets table schema for this asterisk. table may be NULL - then the asterisk becames "all-tables" type asterisk.

Reimplemented from KexiDB::Field.

Definition at line 1611 of file queryschema.cpp.

References KexiDBDbg, and m_table.

virtual TableSchema* KexiDB::QueryAsterisk::table  )  const [inline, virtual]
 

Returns:
Table schema for this asterisk if it has "single-table" type (1st type) or NULL if it has "all-tables" type (2nd type) defined.

Reimplemented from KexiDB::Field.

Definition at line 792 of file queryschema.h.

Referenced by debugString().


Friends And Related Function Documentation

friend class QuerySchema [friend]
 

Reimplemented from KexiDB::Field.

Definition at line 813 of file queryschema.h.


Member Data Documentation

TableSchema* KexiDB::QueryAsterisk::m_table [protected]
 

Table schema for this asterisk

Definition at line 811 of file queryschema.h.

Referenced by setTable().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:47 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003