Revision 95b60eb2
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/entitymanager.cpp | ||
---|---|---|
bool rc = false;
|
||
this->db->startTransaction();
|
||
this->removeRelations(entity);
|
||
QSqlQuery q = this->schema.data()->getQueryBuilder().data()->remove(entity);
|
||
if (q.exec() && this->db->commitTransaction()) {
|
||
auto queries = this->schema.data()->getQueryBuilder().data()->remove(entity);
|
||
bool ok = true;
|
||
for (int var = 0; var < queries.size(); ++var) {
|
||
auto q = queries.at(var);
|
||
if (!q.exec()) {
|
||
this->db->rollbackTransaction();
|
||
qDebug() << "Remove transaction rolled back";
|
||
ok = false;
|
||
break;
|
||
}
|
||
}
|
||
if (ok && this->db->commitTransaction()) {
|
||
this->cache.remove(entity);
|
||
entity.clear();
|
||
rc = true;
|
Auch abrufbar als: Unified diff
remove inheritance