Projekt

Allgemein

Profil

Herunterladen als
Statistiken
| Zweig: | Revision:
Name Größe Revision Geändert vor Autor Kommentar
  samples 9c269b1f fast 7 Jahren Christian Ehringfeld Revert "Trying to set up a test case for #629, ...
  src 6639f988 fast 6 Jahren Sebastian Diel Fix of #629 - FINALLY!
  tests 6d3b13bc fast 7 Jahren Christian Ehringfeld fix?!
.gitignore 31 Bytes f8748139 mehr als 7 Jahren Christian Ehringfeld fix
.gitlab-ci.yml 775 Bytes fe8705df mehr als 8 Jahren Christian Ehringfeld ...
.travis.yml 602 Bytes 63d91df4 etwa 8 Jahren Christian Ehringfeld again travis
AUTHORS 82 Bytes 54538efb mehr als 8 Jahren Christian Ehringfeld orga stuff
Doxyfile 102 KB 57d6da31 mehr als 8 Jahren Christian Ehringfeld structure
EntityManager.pri 945 Bytes 79e33d0c etwa 8 Jahren Christian Ehringfeld ...
EntityManager.pro 164 Bytes efe7a06f mehr als 7 Jahren Christian Ehringfeld added "overriden" to EM_MACRO
LICENSE 7,47 KB 790ec827 mehr als 8 Jahren Christian Ehringfeld .
README.md 4,46 KB 1701766b mehr als 8 Jahren Christian Ehringfeld ticket #596
appveyor.yml 889 Bytes dbd41a3a etwa 8 Jahren Christian Ehringfeld ...

Aktuellste Revisionen

# Datum Autor Kommentar
6639f988 28.04.2018 17:59 Sebastian Diel

Fix of #629 - FINALLY!

dcf04089 04.06.2017 16:13 Christian Ehringfeld

Revert "Merge branch 'master' of ssh://synlos.net/entitymanager"

This reverts commit 279f967de7237e947cb3d9639219e3eb583b8f2b, reversing
changes made to 6d3b13bc614a6ab900da03196265768c8a8eb5e3.

279f967d 04.06.2017 12:55 Christian Ehringfeld

Merge branch 'master' of ssh://synlos.net/entitymanager

0a260288 24.04.2017 21:26 Sebastian Diel

fixing a forgotten curly bracket

b64bf874 22.04.2017 01:22 Sebastian Diel

Hotfixes a crash with ONE_TO_ONE use (Incident::m_predecessor), not sure
if relation actually works now.

6d3b13bc 16.04.2017 21:08 Christian Ehringfeld

fix?!

edef7577 15.04.2017 23:05 Sebastian Diel

Include sqlite sources directly instead of using Qt's .pri (now
incompatible with use from outside Qt itself)

9c269b1f 15.04.2017 14:31 Christian Ehringfeld

Revert "Trying to set up a test case for #629, new problem with "silent" crash"

This reverts commit 59e17af2ab165f2e2db22ff3831822d17ba8b8ff.

6734364c 15.04.2017 14:31 Christian Ehringfeld

Revert "Pupil persisting problem"

This reverts commit 57853172b5a545ed71b9c36c8a874e98b998c5c1.

1a9e6412 15.04.2017 14:31 Christian Ehringfeld

Revert "Working at last"

This reverts commit 1bbd25fae3be299db961efe0c38a5ae048e89171.

Alle Revisionen anzeigen | Revisionen anzeigen

README


CuteEntityManager for Qt

Build status

English

With CuteEntityManager it is possible to persist, merge, find or delete entities. Its functionality is based on JPA's EntityManager. For a different application I was in search of an easy-to-use ORM. Those particular libraries had either additional dependencies, a smaller functional range, were too "complicated" to use (imho) or bound to specific platforms.

CuteEntityManager basically supports all platforms supported by Qt. Because I am a Java & PHP developer for a living, CuteEntityManager is conceptionally based on the aforementioned EntityManager of JPA and in parts on the PHP Yii framework.

CuteEntityManager builds solely on Qt/C++ techniqes. The properties for the ORM are established by the usage of QPROPERTY macros. It is possible to use inheritance. Of course, relations (ONETOONE, MANYTOONE, ONETOMANY and MANYTO_MANY) are also possible. To simplify SELECT statements there is a Query API. Thus, it's possible to implement a whole application with database connection without using a single bit of SQL. Of course, you should be aware of the "specifics" of a relational database (notably in matters of relations). Currently, only SQLite support is passably tested. Extensions for MySQL/PGSQL/MSSQL should be possible quite smoothly.

CuteEntityManager is definitely far from a proper (and tested) or even finished state, but because of its use for the creation of another application, surely this state will successively improve. Criticism, praise, improvement suggestions, pull requests and code reviews are welcome at any time. You can reach me directly by mail under c.ehringfeld[at]t-online.de.

Features

  • sql table creation based on the Q_PROPERTY macro
  • relational tables can be generated based on getRelations() method (/* hash.insert("addresses", CuteEntityManager::Relation("addresses",RelationType::MANYTOMANY)) */ -> creates table "person_addresses"
  • eager data fetch
  • CRUD operations with simple method calls (e.g. entitymanager->create(sharedPtr);)
  • query api (object-oriented method for building SQL queries)
  • Object-Relational Mapping (ORM)
  • Multiple instances (- every Database Entity must inherit from CuteEntityManager::Entity)

Updated daily doxygen documentation: http://jenkins.danfai.de/jenkins/job/cuteentitymanager/doxygen/ Tutorial(wip): https://synlos.net/redmine/projects/entitymanager/wiki/Tutorial

Minimum requirements

  • GCC 4.8 or clang 3.3
  • >= Qt 5.4
  • any platform supported by Qt

German

Mit dem CuteEntityManager ist es möglich, Entities zu persistieren, zu mergen, zu finden und zu löschen. Die Funktionalität ist dem EntityManager der JPA nachempfunden. Für eine andere Anwendung war ich auf der Suche nach einem leicht zu benutzenden ORM. Entweder enthielten die jeweiligen Librarys zusätzliche Abhängigkeiten, hatten nicht den gewünschten Funktionsumfang, waren in der Benutzung zu "kompliziert"(imho) oder an bestimmte Plattformen gekoppelt.

Der CuteEntityManager unterstützt grundsätzlich alle von Qt unterstützten Plattformen. Da ich hauptberuflich Java & PHP Entwickler bin, ist der CuteEntityManager dem o.g. EntityManager der JPA und zum Teil dem PHP Yii Framework nachempfunden.

Der CuteEntityManager basiert ausschließlich auf Qt/C++ Techniken. Die Properties für das ORM werden anhand von QPROPERTY Makros festgelegt. Es ist möglich Vererbung zu nutzen. Relationen (ONETOONE, MANYTOONE, ONETOMANY und MANYTO_MANY) sind natürlich auch möglich. Um SELECT Statements zu vereinfachen, gibt es eine Query API. Man kann also ohne ein Stückchen SQL eine komplette Anwendung mit SQL-Datenbank Anbindung implementieren. Man sollte sich natürlich über die "Besonderheiten" einer relationalen Datenbank im Klaren sein (insbesondere eben bei Relationen). Aktuell ist nur die SQLite Unterstützung einigermaßen getestet. Erweiterungen für MySQL/PGSQL/MSSQL sollten relativ problemlos möglich sein.

Der CuteEntityManager ist sicherlich weit davon entfernt, in einem guten (getesteten) bzw. fertigen Zustand zu sein, da er aber für die Entwicklung einer anderen Anwendung genutzt wird, wird sich der Zustand sicherlich fortlaufend verbessern. Kritik, Lob, Verbesserungsvorschläge, Pull Requests, Code Reviews sind jederzeit willkommen. Man kann mich auf direktem Wege per Mail an c.ehringfeld[at]t-online.de erreichen.

Auch abrufbar als: Atom