Revision 7d60c5a2
Von Christian Ehringfeld vor mehr als 9 Jahren hinzugefügt
src/entityinstancefactory.cpp | ||
---|---|---|
|
||
Entity *EntityInstanceFactory::createInstance(const char *className,
|
||
const QHash<QString, QVariant> &attributes) {
|
||
Entity *e = EntityInstanceFactory::createInstance(className);
|
||
Entity *e = EntityInstanceFactory::createInstance(className);
|
||
e = EntityInstanceFactory::setAttributes(e, attributes);
|
||
return e;
|
||
}
|
||
... | ... | |
|
||
Entity *EntityInstanceFactory::setAttributes(Entity *&e,
|
||
const QHash<QString, QVariant> &attributes) {
|
||
if(!attributes.isEmpty()) {
|
||
auto metaprops = e->getMetaProperties();
|
||
return EntityInstanceFactory::setAttributes(e, attributes, metaprops);
|
||
if (!attributes.isEmpty()) {
|
||
auto metaprops = e->getMetaProperties();
|
||
return EntityInstanceFactory::setAttributes(e, attributes, metaprops);
|
||
} else {
|
||
return e;
|
||
}
|
src/entitymanager.cpp | ||
---|---|---|
QSharedPointer<Entity> EntityManager::convert(const QHash<QString, QVariant>
|
||
&map,
|
||
const char *classname, const bool refresh) {
|
||
auto e = EntityInstanceFactory::createInstance(
|
||
classname, map);
|
||
auto ptr = QSharedPointer<Entity>(e);
|
||
auto ptr = QSharedPointer<Entity>(EntityInstanceFactory::createInstance(
|
||
classname, map));
|
||
this->cache.insert(ptr);
|
||
this->resolveRelations(ptr, map, refresh);
|
||
return ptr;
|
src/querybuilder.cpp | ||
---|---|---|
|
||
|
||
QString QueryBuilder::transformTypeToAbstractDbType(QString typeName) const {
|
||
QHash<QString, QString> *m = this->schema->getAbstractTypeMap().data();
|
||
auto m = this->schema->getAbstractTypeMap();
|
||
if (m->contains(typeName)) {
|
||
return m->value(typeName);
|
||
}
|
||
... | ... | |
/**
|
||
* @WARNING
|
||
*/
|
||
QHash<QString, QString> *tMap = this->schema->getTypeMap().data();
|
||
auto tMap = this->schema->getTypeMap();
|
||
if (tMap->contains(type)) {
|
||
return this->transformAbstractTypeToRealDbType(type);
|
||
}
|
Auch abrufbar als: Unified diff
...