Revision 949b3ea3
Von Christian Ehringfeld vor mehr als 7 Jahren hinzugefügt
src/entitymanager.cpp | ||
---|---|---|
QSharedPointer<Entity> &e,
|
||
const bool refresh) {
|
||
QSharedPointer<Entity> r;
|
||
if (e && (refresh || !(r = this->cache.get(id, EntityHelper::getClassname(e.data()))))) {
|
||
if (e && (refresh ||
|
||
!(r = this->cache.get(id, EntityHelper::getBaseClassName(e.data(), true))))) {
|
||
auto map = this->findByPk(id, e);
|
||
r = this->convert(map, EntityHelper::getClassname(e.data()), refresh);
|
||
}
|
||
... | ... | |
QString className = attr->getRelatedClass()->className();
|
||
QSharedPointer<Entity> ptr = QSharedPointer<Entity>();
|
||
if (!(this->cache.contains(convertedId, className)
|
||
/** @todo use Baseclass */
|
||
&& (ptr = this->cache.get(convertedId, className)))) {
|
||
ptr = this->findById(convertedId, className);
|
||
}
|
||
... | ... | |
QSqlQuery q = this->queryInterpreter->build(query);
|
||
auto listMap = this->convertQueryResult(q);
|
||
auto entities = this->convert(listMap, EntityHelper::getClassname(e.data()));
|
||
EntityHelper::setListProperty(entity,entities,attr->getMetaProperty());
|
||
EntityHelper::setListProperty(entity, entities, attr->getMetaProperty());
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
for (int var = 0; var < listMap.size(); ++var) {
|
||
auto id = listMap.at(var).value(attr->getRelatedColumnName());
|
||
if (!(this->cache.contains(id.toLongLong(), secClassName) &&
|
||
/** @todo use Baseclass */
|
||
(e = this->cache.get(id.toLongLong(), secClassName)))) {
|
||
e = this->findById(id.toLongLong(), secClassName);
|
||
}
|
Auch abrufbar als: Unified diff
fixxes