row clear in query
This commit is contained in:
parent
25815ec242
commit
37915378b1
|
|
@ -152,6 +152,7 @@ Q_OUTOFLINE_TEMPLATE QList<T *> Query<T>::toList(int count)
|
|||
t->setTableSet(d->tableSet);
|
||||
t->setStatus(Table::FeatchedFromDB);
|
||||
t->setParent(this);
|
||||
t->clear();
|
||||
|
||||
result.append(t);
|
||||
lastRow = t;
|
||||
|
|
@ -175,6 +176,7 @@ Q_OUTOFLINE_TEMPLATE QList<T *> Query<T>::toList(int count)
|
|||
childTable->setParentTable(lastRow);
|
||||
childTable->setStatus(Table::FeatchedFromDB);
|
||||
childTable->setTableSet(childTableSet);
|
||||
childTable->clear();
|
||||
childTableSet->add(childTable);
|
||||
}
|
||||
lastPkValue = q.value(pk);
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ void Table::propertyChanged(QString propName)
|
|||
_status = Added;
|
||||
}
|
||||
|
||||
void Table::clear()
|
||||
{
|
||||
_changedProperties.clear();
|
||||
}
|
||||
|
||||
QSet<QString> Table::changedProperties() const
|
||||
{
|
||||
return _changedProperties;
|
||||
|
|
|
|||
|
|
@ -76,6 +76,7 @@ private:
|
|||
TableSetBase *_tableSet;
|
||||
|
||||
QSet<TableSetBase*> tableSets;
|
||||
void clear();
|
||||
|
||||
template<class T>
|
||||
friend class Query;
|
||||
|
|
|
|||
|
|
@ -156,13 +156,6 @@ public:
|
|||
};
|
||||
|
||||
|
||||
//TODO: make FieldPhrase template class
|
||||
//template <typename T>
|
||||
//class FieldPhrase: public WherePhrase{
|
||||
|
||||
//};
|
||||
|
||||
|
||||
template<typename T>
|
||||
Q_OUTOFLINE_TEMPLATE FieldPhrase<T>::FieldPhrase(const char *className, const char *s) : WherePhrase(className, s)
|
||||
{
|
||||
|
|
@ -213,6 +206,8 @@ Q_OUTOFLINE_TEMPLATE WherePhrase FieldPhrase<T>::like(QString pattern)
|
|||
return WherePhrase(this, PhraseData::Like, pattern);
|
||||
}
|
||||
|
||||
|
||||
// Custom types
|
||||
template<>
|
||||
class FieldPhrase<DbGeography>: public WherePhrase {
|
||||
public:
|
||||
|
|
@ -225,6 +220,25 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template<>
|
||||
class FieldPhrase<bool>: public WherePhrase{
|
||||
public:
|
||||
FieldPhrase(const char *className, const char* s) : WherePhrase(className, s){
|
||||
|
||||
}
|
||||
|
||||
WherePhrase operator ==(const bool &other) {
|
||||
return WherePhrase(this, PhraseData::Equal, other ? 1 : 0);
|
||||
}
|
||||
|
||||
WherePhrase operator =(const bool &other) {
|
||||
return WherePhrase(this, PhraseData::Set, other ? 1 : 0);
|
||||
}
|
||||
|
||||
WherePhrase operator !() {
|
||||
return WherePhrase(this, PhraseData::Equal, 0);
|
||||
}
|
||||
};
|
||||
|
||||
NUT_END_NAMESPACE
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue