commit 4d57a79b0fdf616d4bdb0d0fa3b6e03b980d9984
Author: Christian Ehringfeld <c.ehringfeld@t-online.de>
Date:   Tue Oct 6 15:52:16 2015 +0200

    improvement

diff --git a/README.md b/README.md
index 54b63d7..2499051 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # CuteEntityManager for Qt
 
+[![Build status](https://ci.appveyor.com/api/projects/status/upd727lxpxvvxo2v/branch/master?svg=true)](https://ci.appveyor.com/project/Professi/cuteentitymanager/branch/master)
+
 ## English
 With CuteEntityManager it is possible to persist, merge, find or delete 
 entities. Its functionality is based on JPA's EntityManager. For a 
diff --git a/src/entityhelper.h b/src/entityhelper.h
index 2ff9421..df074ca 100644
--- a/src/entityhelper.h
+++ b/src/entityhelper.h
@@ -18,6 +18,7 @@
 #include <QString>
 #include <QHash>
 #include <QMetaProperty>
+#include <QPair>
 namespace CuteEntityManager {
 
 class Relation;
diff --git a/src/entityinspector.cpp b/src/entityinspector.cpp
index 802fe8d..9941939 100644
--- a/src/entityinspector.cpp
+++ b/src/entityinspector.cpp
@@ -136,7 +136,7 @@ bool EntityInspector::verifyRelations(Entity *&entity) {
                 if (!rel) {
                     ok = false;
                 } else {
-                    this->checkRelationMappings(metaProperty, i.value(), ok);
+                    this->checkRelationMappings(metaProperty, i.value(), ok,entity);
                 }
             }
         }
@@ -210,7 +210,7 @@ void EntityInspector::checkRelationTypos(const QString &name, const Relation &r,
 }
 
 void EntityInspector::checkRelationMappings(QMetaProperty &property,
-        const Relation &r, bool &ok) {
+        const Relation &r, bool &ok, Entity *&entity) {
     QString foreignEntityName = EntityInstanceFactory::extractEntityType(
                                     property.typeName());
     auto foreignInstance = EntityInstanceFactory::createInstance(foreignEntityName);
@@ -218,14 +218,21 @@ void EntityInspector::checkRelationMappings(QMetaProperty &property,
         auto foreignRelations = EntityHelper::getRelationProperties(foreignInstance);
         int foundMappedBy = 0;
         bool foundForeignMappedRelation = false;
+        auto superClasses = EntityHelper::superClasses(entity,true);
+        QStringList classNames = QStringList {EntityHelper::getClassName(entity)};
+        for (int s = 0; s < superClasses.size(); ++s) {
+           classNames.append(superClasses.at(s)->className());
+        }
         for (auto i = foreignRelations.constBegin(); i != foreignRelations.constEnd();
                 ++i) {
-            /**
-              * @todo compare classes of properties
-              **/
             if (r.getMappedBy().isEmpty()
                     && i.key().getMappedBy() == r.getPropertyName()) {
-                ++foundMappedBy;
+                for (int x = 0; x < classNames.size(); ++x) {
+                    if(QString(i.value().typeName()).contains(classNames.at(x))) {
+                        ++foundMappedBy;
+                        break;
+                    }
+                }
             } else if (!r.getMappedBy().isEmpty()
                        && r.getMappedBy() == i.key().getPropertyName()) {
                 foundForeignMappedRelation = true;
@@ -241,8 +248,8 @@ void EntityInspector::checkRelationMappings(QMetaProperty &property,
                 this->logger->logMsg("The relation " + r.getPropertyName() +
                                      " is mapped several times (" +
                                      QString::number(foundMappedBy) + ") by foreign class " + foreignEntityName +
-                                     ". You should map it only once!\n", MsgType::WARNING);
-                ok = false;
+                                     ". You should map it only once!\n",
+                                     MsgType::WARNING);
             }
         } else if (!foundForeignMappedRelation) {
             this->logger->logMsg("Relation " + r.getPropertyName() +
diff --git a/src/entityinspector.h b/src/entityinspector.h
index ec207b3..210d5b6 100644
--- a/src/entityinspector.h
+++ b/src/entityinspector.h
@@ -44,7 +44,7 @@ class EntityInspector {
     void checkRelationTypos(const QString &name, const Relation &r,
                             bool &ok);
     void checkRelationMappings(QMetaProperty &property, const Relation &r,
-                               bool &ok);
+                               bool &ok, Entity *&entity);
     bool checkPrimaryKey(Entity *&entity);
     void verifyBlobAttributes(Entity *&entity);
     void checkMetaProperties(QHash<QString, QMetaProperty> &metaProperties,
