Revision 35cf13b7
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
src/entitymanager.cpp | ||
---|---|---|
auto list = EntityInstanceFactory::castQVariantList(var);
|
||
if (!list.contains(add)) {
|
||
list.append(add);
|
||
this->setListProperty(entity,list,property);
|
||
this->setListProperty(entity, list, property);
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
builder->generateManyToManyColumnName(entity),
|
||
builder->generateManyToManyColumnName(ptr));
|
||
q.bindValue(0, entity->getId());
|
||
auto prop = this->mappedProperty(r,ptr);
|
||
auto prop = this->mappedProperty(r, ptr);
|
||
QSharedPointer<Entity> item;
|
||
for (int var = 0; var < saved.size(); ++var) {
|
||
item = list.at(var);
|
||
... | ... | |
}
|
||
|
||
|
||
QMetaProperty EntityManager::mappedProperty(const Relation &r, const QSharedPointer<Entity> &foreignEntity) const
|
||
{
|
||
QMetaProperty EntityManager::mappedProperty(const Relation &r,
|
||
const QSharedPointer<Entity> &foreignEntity) const {
|
||
QMetaProperty prop;
|
||
auto props = foreignEntity->getMetaProperties();
|
||
if (!r.getMappedBy().isEmpty()) {
|
||
... | ... | |
}
|
||
} else {
|
||
auto relations = foreignEntity->getRelations();
|
||
for (auto iterator = relations.constBegin();iterator != relations.constEnd(); ++iterator) {
|
||
for (auto iterator = relations.constBegin(); iterator != relations.constEnd();
|
||
++iterator) {
|
||
auto rel = iterator.value();
|
||
if(rel.getMappedBy() == r.getPropertyName()) {
|
||
if (rel.getMappedBy() == r.getPropertyName()) {
|
||
prop = props.value(rel.getPropertyName());
|
||
break;
|
||
}
|
Auch abrufbar als: Unified diff
small cleanup