Revision 3938a37e
Von Christian Ehringfeld vor mehr als 8 Jahren hinzugefügt
src/querybuilder.cpp | ||
---|---|---|
#include <QRegularExpression>
|
||
#include "entityinstancefactory.h"
|
||
#include "entityhelper.h"
|
||
#include "logger.h"
|
||
|
||
using namespace CuteEntityManager;
|
||
|
||
... | ... | |
&& this->createRelationTables(entity)))) {
|
||
rc = true;
|
||
} else {
|
||
qWarning() << "Table " << entity->getTablename() << " could not be created.";
|
||
this->database->getLogger()->logMsg("Table " + entity->getTablename() +
|
||
" could not be created.", MsgType::WARNING);
|
||
}
|
||
this->schema->getTableSchema(tableName);
|
||
}
|
||
... | ... | |
auto query = this->database->getQuery(this->createTable(i.key(), i.value()));
|
||
if (!this->database->exec(query)) {
|
||
ok = false;
|
||
qWarning() << "Relational table for table " << entity->getTablename() <<
|
||
" could not be created." << " Tablename:" << i.key();
|
||
this->database->getLogger()->logMsg("Relational table for table " +
|
||
entity->getTablename() +
|
||
" could not be created." + " Tablename:" + i.key(), MsgType::WARNING);
|
||
break;
|
||
}
|
||
++i;
|
||
... | ... | |
if (entity) {
|
||
return this->generateColumnNameID(entity->getTablename());
|
||
}
|
||
qWarning() << "Entity is empty!";
|
||
this->database->getLogger()->logMsg("Entity is empty!", MsgType::WARNING);
|
||
return "";
|
||
}
|
||
|
||
... | ... | |
this->saveAttributes(entity, this->processProperties(e, usedProperties),
|
||
this->processRelations(e, usedRelations)), e->getPrimaryKey()));
|
||
} else {
|
||
qWarning() << "Instance of " << metaObj->className() << " could not be created";
|
||
this->database->getLogger()->logMsg("Instance of " + QString(metaObj->className()) +
|
||
" could not be created", MsgType::CRITICAL);
|
||
break;
|
||
}
|
||
}
|
Auch abrufbar als: Unified diff
logger