kexi

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 778 of file queryschema.h.


Public Member Functions

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

Protected Member Functions

virtual Fieldcopy () const

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 1816 of file queryschema.cpp.


Member Function Documentation

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

Returns:
Query object for that this asterisk object is defined

Reimplemented from KexiDB::Field.

Definition at line 795 of file queryschema.h.

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 800 of file queryschema.h.

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 1834 of file queryschema.cpp.

virtual bool KexiDB::QueryAsterisk::isQueryAsterisk (  )  const [inline, virtual]

Reimplemented.

Reimplemented from KexiDB::Field.

Definition at line 807 of file queryschema.h.

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 811 of file queryschema.h.

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 815 of file queryschema.h.

QString QueryAsterisk::debugString (  )  const [virtual]

Returns:
String for debugging purposes.

Reimplemented from KexiDB::Field.

Definition at line 1840 of file queryschema.cpp.

Field * QueryAsterisk::copy (  )  const [protected, virtual]

Returns:
a deep copy of this object. Used in FieldList(const FieldList& fl).

Reimplemented from KexiDB::Field.

Definition at line 1829 of file queryschema.cpp.


Member Data Documentation

Table schema for this asterisk

Definition at line 825 of file queryschema.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys