A structure that describes a query for query() More...
#include <klflib.h>
Public Member Functions | |
Query () | |
Public Attributes | |
KLFLib::EntryMatchCondition | matchCondition |
int | skip |
int | limit |
int | orderPropId |
Qt::SortOrder | orderDirection |
QList< int > | wantedEntryProperties |
A structure that describes a query for query()
The following properties should be adjusted (by direct access) before calling query().
matchcondition
is an KLFLib::EntryMatchCondition struct that tells which properties have to be matched, how, and to what value. Only entries that match the match condition set in query
will be returned by query(). Note that the match condition itself may be a complex condition, like an OR and AND tree of property matching conditions with strings or regexps. See KLFLib::EntryMatchCondition, and KLFLib::PropertyMatch for more info. The idea is that engines can translate such conditions into, eg. a SQL WHERE condition for optimized entry queries.
The default match condition (set automatically in constructor) matches all entries.
The first skip
results will be ignored, and the first returned result will be the skip
'th entry (that is counting from 0; or the skip+1
'th, counting more intuitively from 1). By default, skip
is zero, so no entries are skipped. The entries must be skipped after they have been sorted. The query() function's return value (entry count) does not include the skipped entries.
A limit
may be set to limit the number of returned results (default is -1
, meaning no limit).
orderPropId
specifies along which KLFLibEntry property ID the items should be ordered. This can be -1
to specify that elements should not be ordered; their order will then be undefined. Default value: -1
.
orderDirection
specifies in which direction the elements should be ordered. This can be Qt::AscendingOrder or Qt::DescendingOrder (lesser value first or greater value first).
wantedEntryProperties
is a list of properties the lists should be filled with. Elements in the entryWithIdList and rawEntryList lists will only have those properties listed in wantedEntryProperties
set. The other properties are undefined (some implementations may decide to ignore this optimization). An empty list (which is the default) indicates that all entry properties have to be set.
|
inline |
int KLFLibResourceEngine::Query::limit |
Definition at line 948 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibResourceSimpleEngine::queryImpl(), KLFLibModelCache::rebuildCache(), and KLFMainWin::slotEvaluate().
KLFLib::EntryMatchCondition KLFLibResourceEngine::Query::matchCondition |
Definition at line 946 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibResourceSimpleEngine::queryImpl(), KLFLibModelCache::rebuildCache(), and KLFMainWin::slotEvaluate().
Qt::SortOrder KLFLibResourceEngine::Query::orderDirection |
Definition at line 950 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibResourceSimpleEngine::queryImpl(), KLFLibModelCache::rebuildCache(), and KLFMainWin::slotEvaluate().
int KLFLibResourceEngine::Query::orderPropId |
Definition at line 949 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibResourceSimpleEngine::queryImpl(), KLFLibModelCache::rebuildCache(), and KLFMainWin::slotEvaluate().
int KLFLibResourceEngine::Query::skip |
Definition at line 947 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibResourceSimpleEngine::queryImpl(), and KLFMainWin::slotEvaluate().
QList<int> KLFLibResourceEngine::Query::wantedEntryProperties |
Definition at line 951 of file klflib.h.
Referenced by KLFLibModelCache::fetchMore(), operator<<(), KLFLibDBEngine::query(), KLFLibModelCache::rebuildCache(), and KLFMainWin::slotEvaluate().