KDbQueryAsterisk
#include <KDbQueryAsterisk.h>
Protected Member Functions | |
KDbQueryAsterisk (KDbQuerySchema *query, const KDbTableSchema *table) | |
KDbField * | copy () override |
Protected Member Functions inherited from KDbField | |
KDbField (KDbFieldList *aParent, int aOrder=-1) | |
KDbField (KDbQuerySchema *querySchema) | |
KDbField (KDbQuerySchema *querySchema, const KDbExpression &expr) | |
void | setOrder (int order) |
void | setParent (KDbFieldList *parent) |
Additional Inherited Members | |
Public Types inherited from KDbField | |
enum | Constraint { NoConstraints = 0 , AutoInc = 1 , Unique = 2 , PrimaryKey = 4 , ForeignKey = 8 , NotNull = 16 , NotEmpty = 32 , Indexed = 64 } |
typedef QFlags< Constraint > | Constraints |
typedef QHash< QByteArray, QVariant > | CustomPropertiesMap |
typedef KDbUtils::AutodeletedList< KDbField * > | List |
typedef QList< KDbField * >::ConstIterator | ListIterator |
enum | MaxLengthStrategy { DefaultMaxLength , DefinedMaxLength } |
enum | Option { NoOptions = 0 , Unsigned = 1 } |
typedef QFlags< Option > | Options |
typedef QPair< KDbField *, KDbField * > | Pair |
typedef QList< Pair > | PairList |
enum | Type { InvalidType = 0 , Byte = 1 , FirstType = 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 = 128 , Asterisk = 129 , Enum = 130 , Map = 131 , Tuple = 132 , LastSpecialType = Tuple } |
enum | TypeGroup { InvalidGroup = 0 , TextGroup = 1 , IntegerGroup = 2 , FloatGroup = 3 , BooleanGroup = 4 , DateTimeGroup = 5 , BLOBGroup = 6 , LastTypeGroup = 6 } |
typedef QVector< KDbField * > | Vector |
Static Public Member Functions inherited from KDbField | |
static QVariant | convertToType (const QVariant &value, Type type) |
static int | defaultMaxLength () |
static bool | hasEmptyProperty (Type type) |
static bool | isAutoIncrementAllowed (Type type) |
static bool | isDateTimeType (Type type) |
static bool | isFPNumericType (Type type) |
static bool | isIntegerType (Type type) |
static bool | isNumericType (Type type) |
static bool | isTextType (Type type) |
static void | setDefaultMaxLength (int maxLength) |
static int | specialTypesCount () |
static Type | typeForString (const QString &typeString) |
static TypeGroup | typeGroup (Type type) |
static TypeGroup | typeGroupForString (const QString &typeGroupString) |
static QString | typeGroupName (TypeGroup typeGroup) |
static QStringList | typeGroupNames () |
static int | typeGroupsCount () |
static QString | typeGroupString (TypeGroup typeGroup) |
static QString | typeName (Type type) |
static QStringList | typeNames () |
static int | typesCount () |
static QString | typeString (Type type) |
static QVariant::Type | variantType (Type type) |
Detailed Description
KDbQueryAsterisk class encapsulates information about single asterisk in query definition.
There are two types of query asterisks:
- "Single-table" asterisk, that references all fields of given table used in the query. Example SQL statement: The "staff.*" element is our "single-table" asterisk; this tells us that we want to get all fields of table "staff".SELECT staff.*, cars.model from staff, cars WHERE staff.car = cars.number;
- "All-tables" asterisk, that references all fields of all tables used in the query. Example SQL statement: The "*" is our "all-tables" asterisk; this tells us that we want to get all fields of all used tables (here: "staff" and "cars").SELECT * from staff, cars WHERE staff.car = cars.number;
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 50 of file KDbQueryAsterisk.h.
Constructor & Destructor Documentation
◆ KDbQueryAsterisk() [1/4]
|
explicit |
Constructs an "all-tables" query asterisk definition object ("*" in SQL notation).
KDbQueryAsterisk objects are owned by KDbQuerySchema object (not by KDbTableSchema object like for ordinary KDbField objects) for that the KDbQueryAsterisk object was added (using KDbQuerySchema::addField()).
Definition at line 35 of file KDbQueryAsterisk.cpp.
◆ KDbQueryAsterisk() [2/4]
KDbQueryAsterisk::KDbQueryAsterisk | ( | KDbQuerySchema * | query, |
const KDbTableSchema & | table ) |
Constructs a "single-table" query asterisk definition object ("T.*" in SQL notation). table schema is the single table for the asterisk.
KDbQueryAsterisk objects are owned by KDbQuerySchema object (not by KDbTableSchema object like for ordinary KDbField objects) for that the KDbQueryAsterisk object was added (using KDbQuerySchema::addField()).
Definition at line 40 of file KDbQueryAsterisk.cpp.
◆ KDbQueryAsterisk() [3/4]
KDbQueryAsterisk::KDbQueryAsterisk | ( | const KDbQueryAsterisk & | asterisk | ) |
Constructs a deep copy of query asterisk definition object asterisk.
Definition at line 52 of file KDbQueryAsterisk.cpp.
◆ ~KDbQueryAsterisk()
|
override |
Definition at line 58 of file KDbQueryAsterisk.cpp.
◆ KDbQueryAsterisk() [4/4]
|
protected |
Definition at line 45 of file KDbQueryAsterisk.cpp.
Member Function Documentation
◆ copy()
|
overrideprotectedvirtual |
- Returns
- a deep copy of this object. Used in KDbFieldList(const KDbFieldList& fl).
Reimplemented from KDbField.
Definition at line 83 of file KDbQueryAsterisk.cpp.
◆ isAllTableAsterisk()
bool KDbQueryAsterisk::isAllTableAsterisk | ( | ) | const |
This is convenience method that returns true
if the asterisk has "single-table" type (2nd type).
Definition at line 98 of file KDbQueryAsterisk.cpp.
◆ isSingleTableAsterisk()
bool KDbQueryAsterisk::isSingleTableAsterisk | ( | ) | const |
This is convenience method that returns true
if the asterisk has "all-tables" type (2nd type).
Definition at line 93 of file KDbQueryAsterisk.cpp.
◆ operator!=()
|
inline |
Returns true
if this query asterisk is not equal to other.
- Returns
false
if objects are equal.
- See also
- operator==(const KDbQueryAsterisk&)
- Since
- 3.1
Definition at line 93 of file KDbQueryAsterisk.h.
◆ operator==()
bool KDbQueryAsterisk::operator== | ( | const KDbQueryAsterisk & | other | ) | const |
Returns true
if this query asterisk is equal to other.
- Returns
false
if the objects are not equal. Two asterisks are equal if they return the same table() and query(). This also means that both return the same value for isSingleTableAsterisk() and isAllTableAsterisk().
- Since
- 3.1
Definition at line 63 of file KDbQueryAsterisk.cpp.
◆ query() [1/2]
KDbQuerySchema * KDbQueryAsterisk::query | ( | ) |
- Returns
- Query object for that this asterisk object is defined
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 68 of file KDbQueryAsterisk.cpp.
◆ query() [2/2]
const KDbQuerySchema * KDbQueryAsterisk::query | ( | ) | const |
Definition at line 73 of file KDbQueryAsterisk.cpp.
◆ setTable()
void KDbQueryAsterisk::setTable | ( | const KDbTableSchema * | table | ) |
Sets table schema for this asterisk. If table is supplied, the asterisk become a "single-table" asterisk. If table is nullptr
the asterisk becames "all-tables" asterisk.
Definition at line 88 of file KDbQueryAsterisk.cpp.
◆ table()
const KDbTableSchema * KDbQueryAsterisk::table | ( | ) | const |
- Returns
- table schema object for that this asterisk object is defined. If this is a "all-tables" asterisk,
nullptr
is returned.
Definition at line 78 of file KDbQueryAsterisk.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.