commit 46d2de488d27bc9d4a0346190a968cedb406c1f0
Author: Christian Ehringfeld <c.ehringfeld@t-online.de>
Date:   Sun Dec 6 16:11:51 2015 +0100

    testcases fixxed

diff --git a/src/attribute.cpp b/src/attribute.cpp
index f5c0ad5..6881892 100644
--- a/src/attribute.cpp
+++ b/src/attribute.cpp
@@ -1,7 +1,70 @@
 #include "attribute.h"
 using namespace CuteEntityManager;
-Attribute::Attribute()
-{
 
+Attribute::Attribute(QString name, QString columnName, QString tableName,
+                     QMetaObject *metaObj, QString relatedTable, QMetaObject *relatedClass,
+                     QString conjunctedTable) {
+    this->name = name;
+    this->tableName = tableName;
+    this->metaObj = metaObj;
+    this->relatedTable = relatedTable;
+    this->relatedClass = relatedClass;
+    this->conjunctedTable = conjunctedTable;
+}
+
+QString Attribute::getName() const {
+    return name;
+}
+
+void Attribute::setName(const QString &value) {
+    name = value;
+}
+
+QString Attribute::getColumnName() const {
+    return columnName;
+}
+
+void Attribute::setColumnName(const QString &value) {
+    columnName = value;
+}
+
+QString Attribute::getTableName() const {
+    return tableName;
+}
+
+void Attribute::setTableName(const QString &value) {
+    tableName = value;
+}
+
+QString Attribute::getRelatedTable() const {
+    return relatedTable;
+}
+
+void Attribute::setRelatedTable(const QString &value) {
+    relatedTable = value;
+}
+
+QMetaObject *Attribute::getRelatedClass() const {
+    return relatedClass;
+}
+
+void Attribute::setRelatedClass(QMetaObject *value) {
+    relatedClass = value;
+}
+
+QString Attribute::getConjunctedTable() const {
+    return conjunctedTable;
+}
+
+void Attribute::setConjunctedTable(const QString &value) {
+    conjunctedTable = value;
+}
+
+QMetaObject *Attribute::getMetaObj() const {
+    return metaObj;
+}
+
+void Attribute::setMetaObj(QMetaObject *value) {
+    metaObj = value;
 }
 
diff --git a/src/attribute.h b/src/attribute.h
index 556ce7f..c664b31 100644
--- a/src/attribute.h
+++ b/src/attribute.h
@@ -6,12 +6,38 @@ namespace CuteEntityManager {
 
 class Attribute {
   public:
-    Attribute();
-private:
+    Attribute(QString name, QString columnName, QString tableName, QMetaObject *metaObj,
+              QString relatedTable = "", QMetaObject *relatedClass = nullptr,
+              QString conjunctedTable = "");
+    QString getName() const;
+    void setName(const QString &value);
+
+    QString getColumnName() const;
+    void setColumnName(const QString &value);
+
+    QString getTableName() const;
+    void setTableName(const QString &value);
+
+    QString getRelatedTable() const;
+    void setRelatedTable(const QString &value);
+
+    QMetaObject *getRelatedClass() const;
+    void setRelatedClass(QMetaObject *value);
+
+    QString getConjunctedTable() const;
+    void setConjunctedTable(const QString &value);
+
+    QMetaObject *getMetaObj() const;
+    void setMetaObj(QMetaObject *value);
+
+  private:
     QString name;
-    QString className;
-    QString relatedClass;
+    QString columnName;
+    QString tableName;
+    QMetaObject *metaObj;
     QString relatedTable;
+    QMetaObject *relatedClass;
+    QString conjunctedTable;
 };
 }
 #endif // ATTRIBUTE_H
diff --git a/src/entityhelper.h b/src/entityhelper.h
index 000f3fa..562bd39 100644
--- a/src/entityhelper.h
+++ b/src/entityhelper.h
@@ -47,8 +47,8 @@ class EntityHelper {
     static const QHash<Relation, QMetaProperty> getRelationProperties(
         const Entity *entity);
     static Entity* copyObject(const Entity *entity);
-    static Entity* getBaseClassObject(const QSharedPointer<Entity> &entity, QString attributeName);
-
+    static Entity* getBaseClassObject(const QSharedPointer<Entity> &entity,
+                                      QString attributeName);
     static const char *getClassname(const Entity *entity);
     static const QString getClassName(const Entity *entity);
     static void addEntityToListProperty(const QSharedPointer<Entity> &entity,
diff --git a/tests/em/tst_querybuilder.cpp b/tests/em/tst_querybuilder.cpp
index fe9ec04..4ba57d9 100644
--- a/tests/em/tst_querybuilder.cpp
+++ b/tests/em/tst_querybuilder.cpp
@@ -96,10 +96,10 @@ void QuerybuilderTest::testFindByAttributesManyToOneRelationAttribute() {
 
 void QuerybuilderTest::testFindByAttributesManyToManyRelation() {
     QHash<QString, QVariant> attributes;
-    attributes["persNumber"] = 42;
+    attributes["firstName"] = "Kristina";
     QSharedPointer<Person> p = e->findEntityByAttributes<Person>(attributes, true);
     QVERIFY(p);
-    QCOMPARE(p->getNickName(), QString("Lotta"));
+    QCOMPARE(p->getFamilyName(), QString("Zero"));
     attributes.clear();
     attributes["persons"] = QVariant(p);
     QSharedPointer<Group> group = e->findEntityByAttributes<Group>
@@ -185,18 +185,21 @@ void QuerybuilderTest::testQueryBuilderArbitraryOperator() {
     q.setLimit(10);
     QList<QSharedPointer<Person>> list = e->find<Person>(q, true);
     QCOMPARE(list.size(), 2);
-    QCOMPARE(list.at(0)->getFirstName(), QString("Janine"));
-    QCOMPARE(list.at(1)->getFirstName(), QString("Lucien"));
+    QCOMPARE(list.at(0)->getFirstName(), QString("Fenja"));
+    QCOMPARE(list.at(0)->getFamilyName(), QString("Sey."));
+    QCOMPARE(list.at(1)->getFirstName(), QString("Fenja"));
+    QCOMPARE(list.at(1)->getFamilyName(), QString("Neu"));
 }
 
 void QuerybuilderTest::testQueryBuilderJoins() {
     auto qb = e->getQueryBuilder();
     Query q = Query();
-    q.appendWhere(q.equal(qb, "firstName", "Kristina"));
+    q.appendWhere(q.equal(qb, "firstName", "Milan"));
     q.appendJoin(Join("person", "person.id = employee.id"));
     QList<QSharedPointer<Employee>> list = e->find<Employee>(q, false);
     QCOMPARE(list.size(), 1);
-    QCOMPARE(list.at(0)->getFirstName(), QString("Kristina"));
+    QCOMPARE(list.at(0)->getFirstName(), QString("Milan"));
+    QCOMPARE(list.at(0)->getFamilyName(), QString("Mes."));
 }
 
 void QuerybuilderTest::testQueryBuilderManyToOneRelation() {
