commit aa44e7d1b48b226bae925e8c9dad33ee1effbc8e
Author: Christian Ehringfeld <c.ehringfeld@t-online.de>
Date:   Sat Mar 21 23:31:08 2015 +0100

    cleanup

diff --git a/EntityManager.pro b/EntityManager.pro
index ebdb7ef..60d5015 100644
--- a/EntityManager.pro
+++ b/EntityManager.pro
@@ -16,17 +16,15 @@ DEFINES += CUTE_ENTITY_MANAGER_LIBRARY
 HEADERS += \
 src/entity.h \
     src/entitymanager.h \
-    src/enums/persistencetype.h \
     src/database.h \
     src/enums/databasetype.h \
-    src/enums/relationtype.h \
-    src/relation.h
+    src/schema.h
 
 SOURCES += \
 src/base/entity.cpp \
     src/entitymanager.cpp \
     src/database.cpp \
-    src/relation.cpp
+    src/schema.cpp
 
 unix {
     target.path = /usr/lib
diff --git a/example/Example.pro b/example/Example.pro
new file mode 100644
index 0000000..e4a1b84
--- /dev/null
+++ b/example/Example.pro
@@ -0,0 +1,23 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2013-08-01T15:03:24
+#
+#-------------------------------------------------
+
+QT       += core
+QT       += sql
+
+QT       -= gui
+
+TARGET = EntityManager
+CONFIG   += console
+CONFIG   -= app_bundle
+
+TEMPLATE = app
+
+
+HEADERS += \
+    models/artikel.h
+
+SOURCES += \
+    models/artikel.cpp
diff --git a/example/main.cpp b/example/main.cpp
new file mode 100644
index 0000000..394518e
--- /dev/null
+++ b/example/main.cpp
@@ -0,0 +1,30 @@
+#include <QCoreApplication>
+#include "src/entitymanager.h"
+#include <typeinfo>
+#include <QDir>
+#include <QDebug>
+/**
+  * create,remove und merge funktionieren
+ */
+
+int main(int argc, char *argv[])
+{
+    OpenTeacherTool::EntityManager *e = new OpenTeacherTool::EntityManager("QSQLITE",QDir::currentPath() + "/db.sqlite");
+
+    OpenTeacherTool::Artikel *b= new OpenTeacherTool::Artikel(30,"Peter123");
+    OpenTeacherTool::Entity *entity = b->getEntity();
+    qDebug() << "findByAttributes:" << e->findByAttributes(entity,true);
+    qDebug() << "create:" << e->create(entity);
+    qDebug() << "findAll:" << e->findAll(entity->getTablename());
+    entity->setAttributes(e->findByAttributes(entity,true).at(0));
+    qDebug() << "AttributeValues, Artikel:" << *b->getAttributeValues();
+    b->setName("Peter");
+    b->setPreis(20);
+    e->remove(entity);
+    qDebug() << "TypID:" << typeid(entity).name();
+    qDebug() << entity->getId();
+    qDebug() << "merge:" << e->merge(entity);
+    delete entity;
+
+    return 0;
+}
diff --git a/src/entity.h b/src/entity.h
index cc98795..c14f45f 100644
--- a/src/entity.h
+++ b/src/entity.h
@@ -19,31 +19,21 @@
 #include <QtGlobal>
 #include <QMap>
 #include <QDebug>
+#include <QObject>
 #include "enums/persistencetype.h"
 #include "enums/databasetype.h"
 namespace CuteEntityManager {
 
-class Entity
-{
+class Entity : public QObject {
+    Q_OBJECT
 public:
-    qint64 getId();
-    void setId(qint64 id);
-    Entity* getEntity();
-    void addAttributeVal(const QString name, QVariant *var);
+    qint64 getId() = 0;
+    void setId(qint64 id) = 0;
     virtual ~Entity();
-    virtual QHash<QString, QString> getProperties(DatabaseType type) = 0;
-    virtual PersistenceType getPersistenceType() = 0;
-    virtual QHash<QString,Entity*>* getRelations() = 0;
-    virtual QHash<QString, QVariant>* getAttributeValues() = 0;
-    virtual void setAttributes(QHash<QString, QVariant>) = 0;
     virtual QString getTablename() = 0;
-    virtual QString idColumnSQL();
     //  virtual QMap<QString, QString> getManyToManyRelations() = 0;   //Key = Table, Value = joined Table Column
 protected:
     Entity();
-    qint64 id;
-    QHash<QString,QVariant> *attributeValues;
-    QHash<QString,Entity*> *relations;
 };
 }
 #endif // MODEL_H
diff --git a/src/enums/persistencetype.h b/src/enums/persistencetype.h
deleted file mode 100644
index 6b42e82..0000000
--- a/src/enums/persistencetype.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PERSISTENCETYPE_H
-#define PERSISTENCETYPE_H
-#include <QObject>
-#include <QMap>
-#include <QString>
-
-namespace CuteEntityManager {
-enum PersistenceType {
-    LOCAL=0,
-    XML=1,
-    REMOTEDATABASE=2
-};
-
-static QMap<PersistenceType, QString> initMap() {
-    QMap<PersistenceType, QString> map;
-    map[LOCAL] = QObject::tr("LocalDatabase");
-    map[XML] = QObject::tr("XMLFile");
-    map[REMOTEDATABASE] = QObject::tr("RemoteDatabase");
-    return map;
-}
-
-static QString toString(const PersistenceType &type) {
-    static QMap<PersistenceType, QString> map = initMap();
-    return map[type];
-}
-
-}
-
-#endif // PERSISTENCETYPE_H
diff --git a/src/enums/relationtype.h b/src/enums/relationtype.h
deleted file mode 100644
index 13d01b4..0000000
--- a/src/enums/relationtype.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef RELATIONTYPE_H
-#define RELATIONTYPE_H
-
-namespace CuteEntityManager{
-
-enum Relationtype {
-    ONETOONE=0,
-    ONETOMANY=1,
-    MANYTOONE=2,
-    MANYTOMANY=3
-};
-
-}
-
-
-#endif // RELATIONTYPE_H
diff --git a/src/relation.cpp b/src/relation.cpp
deleted file mode 100644
index d81a43d..0000000
--- a/src/relation.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "relation.h"
-
-namespace CuteEntityManager {
-
-Relation::Relation()
-{
-}
-
-
-}
diff --git a/src/relation.h b/src/relation.h
deleted file mode 100644
index adc77d3..0000000
--- a/src/relation.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2015 Christian Ehringfeld <c.ehringfeld@t-online.de>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef RELATION_H
-#define RELATION_H
-#include "entity.h"
-#include "src/enums/relationtype.h"
-namespace CuteEntityManager {
-
-class Relation
-{
-public:
-    Relation();
-private:
-    Entity* foreignEntity;
-    OpenTeacherTool::Relationtype Relationtype;
-};
-}
-#endif // RELATION_H
diff --git a/src/schema.cpp b/src/schema.cpp
new file mode 100644
index 0000000..645b383
--- /dev/null
+++ b/src/schema.cpp
@@ -0,0 +1,12 @@
+#include "schema.h"
+
+Schema::Schema()
+{
+
+}
+
+Schema::~Schema()
+{
+
+}
+
diff --git a/src/schema.h b/src/schema.h
new file mode 100644
index 0000000..6277d0e
--- /dev/null
+++ b/src/schema.h
@@ -0,0 +1,12 @@
+#ifndef SCHEMA_H
+#define SCHEMA_H
+
+
+class Schema
+{
+public:
+    Schema();
+    ~Schema();
+};
+
+#endif // SCHEMA_H
diff --git a/test/EntityManager.pro b/test/EntityManager.pro
deleted file mode 100644
index 51fb1f4..0000000
--- a/test/EntityManager.pro
+++ /dev/null
@@ -1,32 +0,0 @@
-#-------------------------------------------------
-#
-# Project created by QtCreator 2013-08-01T15:03:24
-#
-#-------------------------------------------------
-
-QT       += core
-QT       += sql
-
-QT       -= gui
-
-TARGET = EntityManager
-CONFIG   += console
-CONFIG   -= app_bundle
-
-TEMPLATE = app
-
-
-HEADERS += \
-src/entity.h \
-    src/entitymanager.h \
-    src/enums/persistencetype.h \
-    src/database.h \
-    src/enums/databasetype.h \
-    src/enums/relationtype.h \
-    src/relation.h
-
-SOURCES += \
-src/base/entity.cpp \
-    src/entitymanager.cpp \
-    src/database.cpp \
-    src/relation.cpp
diff --git a/test/main.cpp b/test/main.cpp
deleted file mode 100644
index 394518e..0000000
--- a/test/main.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <QCoreApplication>
-#include "src/entitymanager.h"
-#include <typeinfo>
-#include <QDir>
-#include <QDebug>
-/**
-  * create,remove und merge funktionieren
- */
-
-int main(int argc, char *argv[])
-{
-    OpenTeacherTool::EntityManager *e = new OpenTeacherTool::EntityManager("QSQLITE",QDir::currentPath() + "/db.sqlite");
-
-    OpenTeacherTool::Artikel *b= new OpenTeacherTool::Artikel(30,"Peter123");
-    OpenTeacherTool::Entity *entity = b->getEntity();
-    qDebug() << "findByAttributes:" << e->findByAttributes(entity,true);
-    qDebug() << "create:" << e->create(entity);
-    qDebug() << "findAll:" << e->findAll(entity->getTablename());
-    entity->setAttributes(e->findByAttributes(entity,true).at(0));
-    qDebug() << "AttributeValues, Artikel:" << *b->getAttributeValues();
-    b->setName("Peter");
-    b->setPreis(20);
-    e->remove(entity);
-    qDebug() << "TypID:" << typeid(entity).name();
-    qDebug() << entity->getId();
-    qDebug() << "merge:" << e->merge(entity);
-    delete entity;
-
-    return 0;
-}
