commit 19082efecba561175c5b0f172a63f0c180c5325c
Author: Christian Ehringfeld <c.ehringfeld@t-online.de>
Date:   Sun Dec 6 23:19:57 2015 +0100

    Started integration of attribute resolver

diff --git a/src/attributeresolver.h b/src/attributeresolver.h
index 73c2a07..ac521b5 100644
--- a/src/attributeresolver.h
+++ b/src/attributeresolver.h
@@ -24,7 +24,8 @@ class AttributeResolver {
                                          const Relation &r, const QSharedPointer<Entity> &target);
     Attribute* resolveNonRelatedAttribute(const QSharedPointer<Entity> &e,
                                           const QString &attr);
-    const QMetaObject *resolveInheritance(const QSharedPointer<Entity> &e,Attribute *&attribute);
+    const QMetaObject *resolveInheritance(const QSharedPointer<Entity> &e,
+                                          Attribute *&attribute);
     void addAttribute(const QString &className, Attribute *&attr);
     Attribute* resolveExplicitAttribute(const QSharedPointer<Entity> &classObj,
                                         const QString &attribute, QSharedPointer<Entity> related = QSharedPointer<Entity>());
diff --git a/src/entitymanager.cpp b/src/entitymanager.cpp
index a85429e..bec220a 100644
--- a/src/entitymanager.cpp
+++ b/src/entitymanager.cpp
@@ -20,6 +20,7 @@
 #include "entitymanager.h"
 #include "enums/databasetype.h"
 #include "databasemigration.h"
+#include "attributeresolver.h"
 #include "validators/validatorfactory.h"
 #include "validators/validator.h"
 #include "validators/validatorrule.h"
@@ -50,6 +51,8 @@ void EntityManager::init(bool inspect, const MsgType msgType) {
     this->schema->setTables(this->schema->getTableSchemas());
     this->queryInterpreter = QSharedPointer<QueryInterpreter>(new QueryInterpreter(
                                  this->schema->getQueryBuilder().data()));
+    this->ar = QSharedPointer<AttributeResolver>(new AttributeResolver(
+                   this->schema->getQueryBuilder()));
     this->appendToInstanceList();
     if (inspect) {
         EntityInspector inspector = EntityInspector(msgType);
@@ -77,6 +80,7 @@ EntityManager::EntityManager(const QString &databaseType, QString databasename,
 EntityManager::~EntityManager() {
     EntityManager::removeConnectionName(this->db->getConnectionName());
     EntityManager::instances.remove(this->objectName());
+    this->ar = QSharedPointer<AttributeResolver>(nullptr);
 }
 
 
diff --git a/src/entitymanager.h b/src/entitymanager.h
index 4b43f15..6d329d0 100644
--- a/src/entitymanager.h
+++ b/src/entitymanager.h
@@ -44,7 +44,7 @@ namespace CuteEntityManager {
 #define INSPECTENTITIES false
 #endif
 
-
+class AttributeResolver;
 class Logger;
 class QueryInterpreter;
 class EntityManager : public QObject {
@@ -382,6 +382,7 @@ protected:
     static QStringList connectionNames;
     static QHash<QString, EntityManager *> instances;
     QSharedPointer<Logger> logger;
+    QSharedPointer<AttributeResolver> ar;
     QString id;
     QSharedPointer<Schema> schema;
     static void setConnectionNames(QStringList list);
