Revision 42d32a68
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/querybuilder.cpp | ||
---|---|---|
QSqlQuery QueryBuilder::find(const qint64 &id, const QString &tableName) const {
|
||
QString pk = "id";
|
||
QSqlQuery q = this->database->getQuery(this->selectBase(QStringList(
|
||
tableName)) + " WHERE " + pk + " = " + this->placeHolder(pk) + " LIMIT 1;");
|
||
tableName)) + " WHERE " + this->schema->quoteColumnName(pk) + " = " + this->placeHolder(pk) + " LIMIT 1;");
|
||
this->bindValue(pk, id, q);
|
||
return q;
|
||
}
|
||
... | ... | |
const QSharedPointer<Entity> &entity, qint64 offset, QString pk) const {
|
||
QSqlQuery q = this->database->getQuery(this->selectBase(QStringList(
|
||
entity->getTablename())) + this->joinSuperClasses(
|
||
entity) + " WHERE " + this->schema->quoteColumnName(
|
||
pk) + "= " + this->placeHolder(pk) + this->limit(1, offset));
|
||
entity) + " WHERE " + this->schema->quoteColumnName(entity->getTablename() + "." + pk) + "= " + this->placeHolder(pk) + this->limit(1, offset));
|
||
this->bindValue(pk, id, q);
|
||
return q;
|
||
}
|
Auch abrufbar als: Unified diff
fix...