kexi

#include <queryschema.h>

Inheritance diagram for KexiDB::QueryAsterisk:
KexiDB::Field

Public Member Functions

 QueryAsterisk (QuerySchema *query, TableSchema *table=0)
QuerySchema * query () const
virtual TableSchema * table () const
virtual void setTable (TableSchema *table)
virtual bool isQueryAsterisk () const
bool isSingleTableAsterisk () const
bool isAllTableAsterisk () const
virtual TQString debugString () const
Public Member Functions inherited from KexiDB::Field
 Field (TableSchema *tableSchema)
 Field ()
 Field (const TQString &name, Type ctype, uint cconst=NoConstraints, uint options=NoOptions, uint length=0, uint precision=0, TQVariant defaultValue=TQVariant(), const TQString &caption=TQString(), const TQString &description=TQString(), uint width=0)
 Field (const Field &f)
TQString name () const
QuerySchema * query () const
void setQuery (QuerySchema *query)
bool isAutoIncrement () const
bool isPrimaryKey () const
bool isUniqueKey () const
bool isForeignKey () const
bool isNotNull () const
bool isNotEmpty () const
bool isIndexed () const
bool isNumericType () const
bool isIntegerType () const
bool isFPNumericType () const
bool isDateTimeType () const
bool isTextType () const
uint options () const
void setOptions (uint options)
TQVariant::Type variantType () const
Type type () const
TQString typeName () const
TypeGroup typeGroup () const
TQString typeGroupName () const
TQString typeString () const
TQString typeGroupString () const
TQString subType () const
void setSubType (const TQString &subType)
TQVariant defaultValue () const
uint length () const
uint precision () const
uint scale () const
int visibleDecimalPlaces () const
uint constraints () const
int order () const
TQString caption () const
TQString captionOrName () const
TQString description () const
uint width () const
bool isUnsigned () const
bool hasEmptyProperty () const
bool isAutoIncrementAllowed () const
void setType (Type t)
void setName (const TQString &name)
void setConstraints (uint c)
void setLength (uint l)
void setScale (uint s)
void setVisibleDecimalPlaces (int p)
void setPrecision (uint p)
void setUnsigned (bool u)
void setDefaultValue (const TQVariant &def)
bool setDefaultValue (const TQCString &def)
void setAutoIncrement (bool a)
void setPrimaryKey (bool p)
void setUniqueKey (bool u)
void setForeignKey (bool f)
void setNotNull (bool n)
void setNotEmpty (bool n)
void setIndexed (bool s)
void setCaption (const TQString &caption)
void setDescription (const TQString &description)
void setWidth (uint w)
void debug ()
KexiDB::BaseExpr * expression ()
void setExpression (KexiDB::BaseExpr *expr)
bool isExpression () const
TQValueVector< TQString > enumHints () const
TQString enumHint (uint num)
void setEnumHints (const TQValueVector< TQString > &l)
TQVariant customProperty (const TQCString &propertyName, const TQVariant &defaultValue=TQVariant()) const
void setCustomProperty (const TQCString &propertyName, const TQVariant &value)
const CustomPropertiesMap customProperties () const

Protected Member Functions

virtual Field * copy () const
Protected Member Functions inherited from KexiDB::Field
 Field (QuerySchema *querySchema, BaseExpr *expr=0)
void init ()

Protected Attributes

TableSchema * m_table
Protected Attributes inherited from KexiDB::Field
FieldList * m_parent
TQString m_name
TQString m_subType
uint m_constraints
uint m_length
uint m_precision
int m_visibleDecimalPlaces
uint m_options
TQVariant m_defaultValue
int m_order
TQString m_caption
TQString m_desc
uint m_width
TQValueVector< TQString > m_hints
KexiDB::BaseExpr * m_expr
CustomPropertiesMap * m_customProperties

Friends

class QuerySchema

Additional Inherited Members

Public Types inherited from KexiDB::Field
enum  Type {
  InvalidType = 0 , Byte = 1 , ShortInteger = 2 , Integer = 3 ,
  BigInteger = 4 , Boolean = 5 , Date = 6 , DateTime = 7 ,
  Time = 8 , Float = 9 , Double = 10 , Text = 11 ,
  LongText = 12 , BLOB = 13 , LastType = 13 , Null = 64 ,
  Asterisk = 128 , Enum = 129 , Map = 130
}
enum  TypeGroup {
  InvalidGroup = 0 , TextGroup = 1 , IntegerGroup = 2 , FloatGroup = 3 ,
  BooleanGroup = 4 , DateTimeGroup = 5 , BLOBGroup = 6 , LastTypeGroup = 6
}
enum  Constraints {
  NoConstraints = 0 , AutoInc = 1 , Unique = 2 , PrimaryKey = 4 ,
  ForeignKey = 8 , NotNull = 16 , NotEmpty = 32 , Indexed = 64
}
enum  Options { NoOptions = 0 , Unsigned = 1 }
typedef TQPtrList< Field > List
typedef TQPtrVector< Field > Vector
typedef TQPtrListIterator< Field > ListIterator
typedef TQPair< Field *, Field * > Pair
typedef TQPtrList< Pair > PairList
typedef TQMap< TQCString, TQVariant > CustomPropertiesMap
Static Public Member Functions inherited from KexiDB::Field
static uint defaultTextLength ()
static TQVariant::Type variantType (uint type)
static TQString typeName (uint type)
static TQString typeString (uint type)
static Type typeForString (const TQString &typeString)
static TypeGroup typeGroupForString (const TQString &typeGroupString)
static TypeGroup typeGroup (uint type)
static TQString typeGroupName (uint typeGroup)
static TQString typeGroupString (uint typeGroup)
static bool isNumericType (uint type)
static bool isIntegerType (uint type)
static bool isFPNumericType (uint type)
static bool isDateTimeType (uint type)
static bool isTextType (uint type)
static bool hasEmptyProperty (uint type)
static bool isAutoIncrementAllowed (uint type)
Static Protected Attributes inherited from KexiDB::Field
static FieldTypeNames m_typeNames
static FieldTypeGroupNames m_typeGroupNames

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.

Constructor & Destructor Documentation

◆ QueryAsterisk()

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.

◆ ~QueryAsterisk()

QueryAsterisk::~QueryAsterisk ( )
virtual

Definition at line 1825 of file queryschema.cpp.

Member Function Documentation

◆ copy()

Field * QueryAsterisk::copy ( ) const
protectedvirtual
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.

◆ debugString()

TQString QueryAsterisk::debugString ( ) const
virtual
Returns
String for debugging purposes.

Reimplemented from KexiDB::Field.

Definition at line 1840 of file queryschema.cpp.

◆ isAllTableAsterisk()

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.

◆ isQueryAsterisk()

virtual bool KexiDB::QueryAsterisk::isQueryAsterisk ( ) const
inlinevirtual

Reimplemented.

Reimplemented from KexiDB::Field.

Definition at line 807 of file queryschema.h.

◆ isSingleTableAsterisk()

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.

◆ query()

QuerySchema * KexiDB::QueryAsterisk::query ( ) const
inline
Returns
Query object for that this asterisk object is defined

Definition at line 795 of file queryschema.h.

◆ setTable()

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.

◆ table()

virtual TableSchema * KexiDB::QueryAsterisk::table ( ) const
inlinevirtual
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.

◆ QuerySchema

friend class QuerySchema
friend

Definition at line 827 of file queryschema.h.

Member Data Documentation

◆ m_table

TableSchema* KexiDB::QueryAsterisk::m_table
protected

Table schema for this asterisk

Definition at line 825 of file queryschema.h.


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