Revision 506067a2
Von Christian Ehringfeld vor mehr als 8 Jahren hinzugefügt
src/entitymanager.cpp | ||
---|---|---|
schema = value;
|
||
}
|
||
|
||
QList<QHash<QString, QVariant> > EntityManager::selectByQuery(Query &query) {
|
||
QSqlQuery q = this->queryInterpreter->build(query);
|
||
return this->convertQueryResult(q);
|
||
}
|
||
|
||
QList<QHash<QString, QVariant> > EntityManager::selectBySql(
|
||
const QString &sql) {
|
||
QSqlQuery q = this->db->select(sql);
|
||
return this->convertQueryResult(q);
|
||
}
|
||
|
||
qint8 EntityManager::count(Query &query) {
|
||
qint8 rc = 0;
|
||
query.appendSelect("COUNT(*)");
|
||
QSqlQuery q = this->queryInterpreter->build(query);
|
||
this->db->select(q);
|
||
if (q.next()) {
|
||
rc = q.value(0).toInt();
|
||
}
|
||
return rc;
|
||
}
|
||
|
||
QString EntityManager::createConnection() {
|
||
QStringList l = EntityManager::getConnectionNames();
|
||
QString conName = "";
|
||
... | ... | |
createRelationTables);
|
||
}
|
||
|
||
qint8 EntityManager::count(const QSharedPointer<Entity> &entity,
|
||
bool ignoreID) {
|
||
quint8 EntityManager::count(const QSharedPointer<Entity> &entity,
|
||
bool ignoreID) {
|
||
qint8 rc = -1;
|
||
QSqlQuery q = this->schema->getQueryBuilder()->count(entity,
|
||
ignoreID);
|
||
... | ... | |
return rc;
|
||
}
|
||
|
||
qint8 EntityManager::count(const QString &tableName) {
|
||
quint8 EntityManager::count(const QString &tableName) {
|
||
qint8 rc = -1;
|
||
QSqlQuery q = this->schema->getQueryBuilder()->count(tableName);
|
||
this->db->select(q);
|
Auch abrufbar als: Unified diff
some improvements