Revision 6bd57432
Von Christian Ehringfeld vor etwa 10 Jahren hinzugefügt
| src/entityinspector.h | ||
|---|---|---|
|
*/
|
||
|
class EntityInspector {
|
||
|
public:
|
||
|
EntityInspector(const MsgType msgType = MsgType::DEBUG);
|
||
|
explicit EntityInspector(const MsgType msgType = MsgType::DEBUG);
|
||
|
~EntityInspector();
|
||
|
bool checkRegisteredEntities();
|
||
|
bool checkEntity(QString name);
|
||
| src/entitymanager.cpp | ||
|---|---|---|
|
property.typeName());
|
||
|
QSharedPointer<Entity> ptr = QSharedPointer<Entity>();
|
||
|
if (refresh || !(this->cache.contains(convertedId, className)
|
||
|
&& (ptr = this->cache.get(convertedId, className)) && ptr)) {
|
||
|
&& (ptr = this->cache.get(convertedId, className)))) {
|
||
|
ptr = this->findById(convertedId, className);
|
||
|
}
|
||
|
EntityHelper::setProperty(entity, ptr, property);
|
||
| ... | ... | |
|
QSharedPointer<Entity> e;
|
||
|
for (int var = 0; var < listMap.size(); ++var) {
|
||
|
auto id = listMap.at(var).value(builder->generateManyToManyColumnName(secEntityPtr));
|
||
|
if ((!refresh && this->cache.contains(id.toLongLong(), secClassName) && (e = this->cache.get(id.toLongLong(), secClassName))) || !e) {
|
||
|
if (refresh || !(this->cache.contains(id.toLongLong(), secClassName) && (e = this->cache.get(id.toLongLong(), secClassName)))) {
|
||
|
e = this->findById(id.toLongLong(), secClassName);
|
||
|
}
|
||
|
if (e) {
|
||
| src/orderby.h | ||
|---|---|---|
|
class OrderBy {
|
||
|
public:
|
||
|
OrderBy();
|
||
|
OrderBy(QString column, Direction direction = Direction::DEFAULT);
|
||
|
explicit OrderBy(QString column, Direction direction = Direction::DEFAULT);
|
||
|
OrderBy(Expression direction);
|
||
|
QString getColumn() const;
|
||
|
void setColumn(const QString &value);
|
||
| src/querybuilder.cpp | ||
|---|---|---|
|
if (!rc) {
|
||
|
QSqlQuery q = this->database->getQuery(this->createTable(tableName,
|
||
|
tableDefinition));
|
||
|
if (this->database->exec(q) && (!createRelationTables || (createRelationTables
|
||
|
&& this->createRelationTables(entity)))) {
|
||
|
if (this->database->exec(q) && (!createRelationTables || this->createRelationTables(entity))) {
|
||
|
rc = true;
|
||
|
} else {
|
||
|
this->database->getLogger()->logMsg("Table " + entity->getTablename() +
|
||
| ... | ... | |
|
bool ignoreID, const QString &primaryKey) const {
|
||
|
QHash<QString, QVariant>::const_iterator i = h.constBegin();
|
||
|
while (i != h.constEnd()) {
|
||
|
if ((!ignoreID || (ignoreID && !(i.key() == primaryKey)))
|
||
|
if ((!ignoreID || !(i.key() == primaryKey))
|
||
|
&& !i.value().isNull()) {
|
||
|
this->bindValue(i.key(), i.value(), q);
|
||
|
}
|
||
| ... | ... | |
|
bool ignoreID, const QString &primaryKey) const {
|
||
|
QString rc = "";
|
||
|
for (auto i = m.constBegin(); i != m.constEnd(); ++i) {
|
||
|
if (!ignoreID || (ignoreID && i.key() != primaryKey)) {
|
||
|
if (!ignoreID || i.key() != primaryKey) {
|
||
|
if (!rc.isEmpty()) {
|
||
|
rc += " " + conjunction + " ";
|
||
|
}
|
||
| ... | ... | |
|
const {
|
||
|
auto classes = EntityHelper::superClasses(entity.data(), true);
|
||
|
QString joined = "";
|
||
|
Entity *e = nullptr;
|
||
|
for (int var = 0; var < classes.size(); ++var) {
|
||
|
auto metaObject = classes.at(var);
|
||
|
e = EntityInstanceFactory::createInstance(metaObject->className());
|
||
|
Entity *e = EntityInstanceFactory::createInstance(metaObject->className());
|
||
|
if (e) {
|
||
|
joined.append(" ");
|
||
|
joined.append(this->leftJoin(e->getTablename(), entity->getTablename(),
|
||
Auch abrufbar als: Unified diff
style and deleted redudant conditions