|
Nut
0.1
|
This class hold a query. More...
Public Member Functions | |
| Query (Database *database, TableSetBase *tableSet) | |
| QList< T * > | toList (int count=-1) |
| int | remove () |
| T * | first () |
| int | count () |
| QVariant | max (FieldPhrase &f) |
| QVariant | min (FieldPhrase &f) |
| QVariant | average (FieldPhrase &f) |
| Query< T > * | join (const QString &tableName) |
| Query< T > * | setWhere (WherePhrase where) |
| Where phrase is a phrase using table's static field methods. | |
| Query< T > * | join (Table *c) |
| Query< T > * | orderBy (QString fieldName, QString type) |
| Query< T > * | orderBy (WherePhrase phrase) |
This class hold a query.
A query can be used for getting database rows, editing or deleting without row fetching. A query can be used for getting data from database.
In below code posts is a QList<Post> that contain rows from database from this query:
| Q_OUTOFLINE_TEMPLATE Query< T > * Query< T >::orderBy | ( | WherePhrase | phrase | ) |
| phrase | Order phrase |
| Q_OUTOFLINE_TEMPLATE Query< T > * Query< T >::setWhere | ( | WherePhrase | where | ) |
Where phrase is a phrase using table's static field methods.
In sql this is like below code:
| where | Where phrase |
| Q_OUTOFLINE_TEMPLATE QList< T * > Query< T >::toList | ( | int | count = -1 | ) |
| count | Total rows must be returned |
1.8.1.2