Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fcbf1918

Von Christian Ehringfeld vor mehr als 7 Jahren hinzugefügt

  • ID fcbf1918b5340b7f5a3e9734ba67d76cf8e3b048
  • Vorgänger e105465d
  • Nachfolger c6a0f442

Revert "mergedObjects to QSP"

This reverts commit e105465d396df8ec34387afa9f0dd9ac635563c1.

Unterschiede anzeigen:

src/entitymanager.h
bool merge(QSharedPointer<T> &entity, bool withRelations = true,
const bool validate = true, const bool relationsIgnoreHasChanged = false) {
static_assert(std::is_base_of<Entity, T>::value, "T must inherit from Entity");
auto merged = QList<QSharedPointer<Entity >>();
auto merged = QList<Entity *>();
QSharedPointer<Entity> e = entity;
return this->mergeObject(e, merged, withRelations, validate,
relationsIgnoreHasChanged);
......
const bool ignoreHasChanged = false, const bool validate = true,
const bool relationsIgnoreHasChanged = false) {
static_assert(std::is_base_of<Entity, T>::value, "T must inherit from Entity");
auto merged = QList<QSharedPointer<Entity >>();
auto merged = QList<Entity *>();
QSharedPointer<Entity> e = entity;
return this->saveObject(e, merged, persistRelations,
ignoreHasChanged, validate, relationsIgnoreHasChanged);
......
const bool checkDuplicate = false, const bool validate = true,
const bool relationsIgnoreHasChanged = false) {
static_assert(std::is_base_of<Entity, T>::value, "T must inherit from Entity");
auto merged = QList<QSharedPointer<Entity >>();
auto merged = QList<Entity *>();
QSharedPointer<Entity> e = entity;
return this->createObject(e, merged, persistRelations,
checkDuplicate, validate, relationsIgnoreHasChanged);
......
}
protected:
bool saveObject(QSharedPointer<Entity> &entity, QList<QSharedPointer<Entity >> &mergedObjects,
bool saveObject(QSharedPointer<Entity> &entity, QList<Entity *> &mergedObjects,
const bool persistRelations = true,
const bool ignoreHasChanged = false, const bool validate = true,
const bool relationsIgnoreHasChanged = false);
bool mergeObject(QSharedPointer<Entity> &entity, QList<QSharedPointer<Entity >> &mergedObjects,
bool mergeObject(QSharedPointer<Entity> &entity, QList<Entity *> &mergedObjects,
bool withRelations,
const bool validate, const bool relationsIgnoreHasChanged = false);
bool createObject(QSharedPointer<Entity> &entity,
QList<QSharedPointer<Entity >> &mergedObjects, const bool persistRelations,
QList<Entity *> &mergedObjects, const bool persistRelations,
const bool checkDuplicate, const bool validate,
const bool relationsIgnoreHasChanged = false);
void init(bool inspect, const MsgType msgType);
......
void oneToOne(const QSharedPointer<Entity> &entity, Attribute *&attr,
const QVariant &id = "");
void persistManyToMany(const QSharedPointer<Entity> &entity, const Relation &r,
QVariant &property, QList<QSharedPointer<Entity >> &mergedObjects,
QVariant &property, QList<Entity *> &mergedObjects,
const bool ignoreHasChanged = false, const bool newItem = false);
QList<QHash<QString, QVariant>> findAllByAttributes(const
QSharedPointer<Entity> &entity,
......
* @throw can throw in debug mode a QString exception when the type of any Relation is wrong @see EntityManager::checkRelation
*/
void savePrePersistedRelations(const QSharedPointer<Entity> &entity,
QList<QSharedPointer<Entity >> &mergedObjects, bool ignoreHasChanged = false);
QList<Entity *> &mergedObjects, bool ignoreHasChanged = false);
/**
* @brief EntityManager::savePostPersistedRelations
* @param entity
......
* @throw can throw in debug mode a QString exception when the type of any Relation is wrong @see EntityManager::checkRelation
*/
void savePostPersistedRelations(const QSharedPointer<Entity> &entity,
QList<QSharedPointer<Entity >> &mergedObjects, bool ignoreHasChanged = false,
QList<Entity *> &mergedObjects, bool ignoreHasChanged = false,
bool newItem = false);
QList<QSharedPointer<Entity>> saveRelationEntities(const
QList<QSharedPointer<Entity>> &list, const Relation &r,
QList<QSharedPointer<Entity >> &mergedObjects);
QList<Entity *> &mergedObjects);
/**
* @brief EntityManager::persistManyToMany
* @param entity
......
void persistMappedByRelation(const QList<QSharedPointer<Entity>> &list,
QSqlQuery &q, const QSharedPointer<Entity> &entity,
const QSharedPointer<Entity> &ptr, const Relation &r,
const QString &tblName, QList<QSharedPointer<Entity >> &mergedObjects);
const QString &tblName, QList<Entity *> &mergedObjects);
bool shouldBeSaved(QSharedPointer<Entity> &entity , const Relation &r);
void removeRelations(const QSharedPointer<Entity> &entity);
void removeEntityList(QVariant &var);

Auch abrufbar als: Unified diff