Merge branch 'dev' of https://github.com/HamedMasafi/Nut into dev
This commit is contained in:
commit
6254c11267
|
|
@ -339,5 +339,4 @@ QString PostgreSqlGenerator::createConditionalPhrase(const PhraseData *d) const
|
||||||
return SqlGeneratorBase::createConditionalPhrase(d);
|
return SqlGeneratorBase::createConditionalPhrase(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NUT_END_NAMESPACE
|
NUT_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -159,8 +159,6 @@ protected:
|
||||||
QString agregateText(const AgregateType &t, const QString &arg = QString()) const;
|
QString agregateText(const AgregateType &t, const QString &arg = QString()) const;
|
||||||
QString fromTableText(const QString &tableName, QString &joinClassName, QString &orderBy) const;
|
QString fromTableText(const QString &tableName, QString &joinClassName, QString &orderBy) const;
|
||||||
// QString createWhere(QList<WherePhrase> &wheres);
|
// QString createWhere(QList<WherePhrase> &wheres);
|
||||||
void replaceTableNames(QString &command);
|
|
||||||
void removeTableNames(QString &command);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NUT_END_NAMESPACE
|
NUT_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -186,4 +186,11 @@ void SqlServerGenerator::appendSkipTake(QString &sql, int skip, int take)
|
||||||
.arg(skip).arg(take));
|
.arg(skip).arg(take));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SqlServerGenerator::replaceTableNames(QString &command)
|
||||||
|
{
|
||||||
|
foreach (TableModel *m, TableModel::allModels())
|
||||||
|
command = command
|
||||||
|
.replace("[" + m->className() + "]", m->name() );
|
||||||
|
}
|
||||||
|
|
||||||
NUT_END_NAMESPACE
|
NUT_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,8 @@ public:
|
||||||
QString escapeValue(const QVariant &v) const;
|
QString escapeValue(const QVariant &v) const;
|
||||||
void appendSkipTake(QString &sql, int skip, int take);
|
void appendSkipTake(QString &sql, int skip, int take);
|
||||||
|
|
||||||
|
void replaceTableNames(QString &command);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NUT_END_NAMESPACE
|
NUT_END_NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ class Score : public Nut::Table
|
||||||
NUT_DECLARE_FIELD(int, score, score, setScore)
|
NUT_DECLARE_FIELD(int, score, score, setScore)
|
||||||
|
|
||||||
NUT_FOREGION_KEY(Post, int, post, post, setPost)
|
NUT_FOREGION_KEY(Post, int, post, post, setPost)
|
||||||
NUT_FOREGION_KEY(User, int, user, user, setUser)
|
NUT_FOREGION_KEY(User, QUuid, author, author, setAuthor)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE Score(QObject *parent = Q_NULLPTR);
|
Q_INVOKABLE Score(QObject *parent = Q_NULLPTR);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue