commit 6899f8148c8f180eed8b58d2cf929e8135bfd017
Author: Christian Ehringfeld <c.ehringfeld@t-online.de>
Date:   Thu Mar 19 15:07:45 2015 +0100

    cleanup

diff --git a/EntityManager.pro b/EntityManager.pro
index f1147cf..ebdb7ef 100644
--- a/EntityManager.pro
+++ b/EntityManager.pro
@@ -6,29 +6,29 @@
 
 QT       += core
 QT       += sql
-
 QT       -= gui
 
-TARGET = EntityManager
-CONFIG   += console
-CONFIG   -= app_bundle
-
-TEMPLATE = app
+TARGET = CuteEntityManager
+TEMPLATE = lib
 
+DEFINES += CUTE_ENTITY_MANAGER_LIBRARY
 
 HEADERS += \
-src/base/entity.h \
-    src/base/entitymanager.h \
-    src/base/enums/persistencetype.h \
-    src/base/database.h \
-    src/base/enums/databasetype.h \
-    src/models/artikel.h \
-    src/base/enums/relationtype.h \
-    src/base/relation.h
+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 += main.cpp \
+SOURCES += \
 src/base/entity.cpp \
-    src/base/entitymanager.cpp \
-    src/base/database.cpp \
-    src/models/artikel.cpp \
-    src/base/relation.cpp
+    src/entitymanager.cpp \
+    src/database.cpp \
+    src/relation.cpp
+
+unix {
+    target.path = /usr/lib
+    INSTALLS += target
+}
diff --git a/main.cpp b/main.cpp
deleted file mode 100644
index 0bf888f..0000000
--- a/main.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <QCoreApplication>
-#include "src/base/entity.h"
-#include "src/models/artikel.h"
-#include "src/base/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/database.cpp b/src/database.cpp
index 346993f..a7b8323 100644
--- a/src/database.cpp
+++ b/src/database.cpp
@@ -1,25 +1,21 @@
 /*
-    Database Class for managing a database connection
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 "database.h"
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 
 Database::Database(QSqlDatabase database) {
     this->database = database;
diff --git a/src/database.h b/src/database.h
index f895f2b..fbf7b48 100644
--- a/src/database.h
+++ b/src/database.h
@@ -1,22 +1,18 @@
 /*
-    Header File Database
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 DATABASE_H
 #define DATABASE_H
@@ -30,7 +26,7 @@
 #include <QString>
 #include <QDebug>
 #include "enums/databasetype.h"
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 
 class Database
 {
diff --git a/src/entity.h b/src/entity.h
index c3d1c6f..cc98795 100644
--- a/src/entity.h
+++ b/src/entity.h
@@ -1,22 +1,18 @@
 /*
-    Header File Entity
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 MODEL_H
 #define MODEL_H
@@ -25,7 +21,7 @@
 #include <QDebug>
 #include "enums/persistencetype.h"
 #include "enums/databasetype.h"
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 
 class Entity
 {
diff --git a/src/entitymanager.cpp b/src/entitymanager.cpp
index 6d594ae..fe25793 100644
--- a/src/entitymanager.cpp
+++ b/src/entitymanager.cpp
@@ -1,22 +1,18 @@
 /*
-    Entity Manager for crud operations of entities
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 "entitymanager.h"
 
@@ -25,7 +21,7 @@
  * Fehlermeldungen erstellen am besten eine Exception Klasse diesbzgl. erstellen
  */
 
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 
 
 QStringList EntityManager::connectionNames = QStringList();
diff --git a/src/entitymanager.h b/src/entitymanager.h
index fba157c..a980065 100644
--- a/src/entitymanager.h
+++ b/src/entitymanager.h
@@ -1,22 +1,18 @@
 /*
-    Header File Entity Manager
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 ENTITYMANAGER_H
 #define ENTITYMANAGER_H
@@ -30,7 +26,7 @@
 #include "entity.h"
 #include "database.h"
 
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 
 class EntityManager
 {
diff --git a/src/enums/databasetype.h b/src/enums/databasetype.h
index 154ad69..6b82b0e 100644
--- a/src/enums/databasetype.h
+++ b/src/enums/databasetype.h
@@ -1,27 +1,23 @@
 /*
-    Enum DatabaseType
-    Copyright (C) 2013 Christian Ehringfeld <c.ehringfeld@t-online.de>
-
-    This file is part of OpenTeacherTool.
-
-    OpenTeacherTool is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenTeacherTool 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 General Public License
-    along with OpenTeacherTool.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 DATABASETYPE_H
 #define DATABASETYPE_H
 
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
    enum DatabaseType {
        SQLITE=0,
        PGSQL=1,
diff --git a/src/enums/persistencetype.h b/src/enums/persistencetype.h
index 9c6b78c..6b42e82 100644
--- a/src/enums/persistencetype.h
+++ b/src/enums/persistencetype.h
@@ -1,20 +1,18 @@
 /*
-    OpenTeacherTool, a platform independent tool for schoolteacher
-    Copyright (C) 2013  Yves Bodenheimer, Christian Ehringfeld, David Mock
-    
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    any later version.
-    
-    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 General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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
@@ -22,7 +20,7 @@
 #include <QMap>
 #include <QString>
 
-namespace OpenTeacherTool {
+namespace CuteEntityManager {
 enum PersistenceType {
     LOCAL=0,
     XML=1,
diff --git a/src/enums/relationtype.h b/src/enums/relationtype.h
index 7aebc33..13d01b4 100644
--- a/src/enums/relationtype.h
+++ b/src/enums/relationtype.h
@@ -1,25 +1,23 @@
 /*
-    OpenTeacherTool, a platform independent tool for schoolteacher
-    Copyright (C) 2013  Yves Bodenheimer, Christian Ehringfeld, David Mock
-    
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    any later version.
-    
-    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 General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 OpenTeacherTool{
+namespace CuteEntityManager{
 
 enum Relationtype {
     ONETOONE=0,
diff --git a/src/relation.cpp b/src/relation.cpp
index 95b1f72..d81a43d 100644
--- a/src/relation.cpp
+++ b/src/relation.cpp
@@ -1,24 +1,22 @@
 /*
-    OpenTeacherTool, a platform independent tool for schoolteacher
-    Copyright (C) 2013  Yves Bodenheimer, Christian Ehringfeld, David Mock
-    
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    any later version.
-    
-    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 General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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 OpenTeacherTool {
+namespace CuteEntityManager {
 
 Relation::Relation()
 {
diff --git a/src/relation.h b/src/relation.h
index 5ca959f..adc77d3 100644
--- a/src/relation.h
+++ b/src/relation.h
@@ -1,26 +1,24 @@
 /*
-    OpenTeacherTool, a platform independent tool for schoolteacher
-    Copyright (C) 2013  Yves Bodenheimer, Christian Ehringfeld, David Mock
-    
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    any later version.
-    
-    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 General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
+ * 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/base/enums/relationtype.h"
-namespace OpenTeacherTool {
+#include "src/enums/relationtype.h"
+namespace CuteEntityManager {
 
 class Relation
 {
diff --git a/test/EntityManager.pro b/test/EntityManager.pro
new file mode 100644
index 0000000..51fb1f4
--- /dev/null
+++ b/test/EntityManager.pro
@@ -0,0 +1,32 @@
+#-------------------------------------------------
+#
+# 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
new file mode 100644
index 0000000..394518e
--- /dev/null
+++ b/test/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;
+}
