Home | Download | Quick sample | Tutorial (4) | Manual (2) | Forum | Our customers

QxOrm >> Home

Current version : | QxOrm 1.5.0 - QxOrm library online class documentation - GitHub
| QxEntityEditor 1.2.8

# QxOrm (the engine) + QxEntityEditor (the graphic editor) = the best solution to manage your persistent data layer in C++/Qt !

QxOrm library is an Object Relational Mapping (ORM) database library for C++/Qt developers. With a simple C++ setting function per class (like Hibernate XML mapping file in Java), you have access to the following features :

- Persistence : support most common databases like SQLite, MySQL, PostgreSQL, Oracle, MS SQL Server, MongoDB (with 1-1, 1-n, n-1 and n-n relationships) ;
- Serialization : JSON, binary and XML format ;
- Reflection (or introspection ) : access dynamically to classes definitions, retrieve properties and call classes methods ;
- HTTP web server : standalone multi-threaded HTTP 1.1 web server (support SSL/TLS, persistent connections, cookies, sessions, chunked responses, URL dispatcher/routing) ;
- JSON API : interoperability with other technology than C++/Qt (REST web services, QML applications, scripting language).

QxOrm library has been accepted into the Qt Ambassador Program

QxEntityEditor is a graphic editor for QxOrm library : QxEntityEditor provides a graphic way to manage the data model.
QxEntityEditor is multi-platform (available for Windows, Linux and Mac OS X) and generates native code for all environments : desktop (Windows, Linux, Mac OS X), embedded and mobile (Android, iOS, Windows Phone, Raspberry Pi, etc.).
A user manual (documentation) for QxEntityEditor application is available.
QxEntityEditor is based on plugins and provides many ways to import/export your data model :

- generate C++ persistent classes automatically (registered in QxOrm context) ;
- generate DDL SQL script automatically (database schema) for SQLite, MySQL, PostgreSQL, Oracle and MS SQL Server ;
- manage schema evolution for each project version (ALTER TABLE, ADD COLUMN, DROP INDEX, etc.) ;
- transfer your data model over network and create quickly client/server applications, using QxService module ;
- import existing database structure (using ODBC connection or native drivers) for SQLite, MySQL, PostgreSQL, Oracle and MS SQL Server databases ;
- because each project is different, QxEntityEditor provides several ways to customize generated files (especially a javascript engine and an integrated debugger).

QxOrm library is designed to make easier C++ development and provides many functionalities.
Here is a list of advantages of QxOrm library :

- non intrusive : the C++ setting function per class doesn't modify class definition, QxOrm can be used in existing projects ;
- no XML mapping file ;
- classes doesn't need to inherit from a 'super object' ;
- template meta-programming : no macro hack ;
- works with Visual C++ on Windows, GCC on Linux, Clang on Mac OS X, and MinGW on Windows (other platforms will be tested soon : smartphones, etc...) ;
- only one file <QxOrm.h> to include in precompiled-header (precompiled-header file is recommended to reduce compilation times).

QxOrm is based on Qt framework (support Qt4, Qt5, Qt6) :

Qt : cross-platform application development framework : GUI (QtGui), network (QtNetwork), XML (QtXml), database (QtSql)...
Qt provides excellent support and documentation. Using Qt, you can write simple and powerful C++ code.
Qt is produced by Digia's Qt Development Frameworks division and is available under LGPL license.
QxOrm is compatible with many Qt's objects : QObject, QString, QDate, QTime, QDateTime, QList, QHash, QSharedPointer, QScopedPointer...
It is recommended to install the latest version of Qt available at the following address : http://www.qt.io/

QxOrm provides the following modules :

- QxDao : based on Qt QtSql engine, this module provides communication with databases (select, update, delete, transaction...) by mapping database table columns with C++ class properties. The relationships 1-1, 1-n, n-1 and n-n are easy to setup in C++ code. This module supports object-oriented programming : inheritance, polymorphism, modularity. It supports also many containers (stl, boost and Qt : std::vector, std::list, std::unordered_map, QList, QHash...).

- QxRegister, QxDataMember, QxFactory and QxFunction : QxOrm emulates reflection (or introspection) mechanism (like other languages : Java, C#...).

- QxModelView : each class registered in QxOrm context can be used by the Qt model/view engine (Qt widgets and/or QML views). qx::IxModel interface exposes automatically to QML engine all properties defined in QxOrm context. This module makes easier interaction between QML and databases.

- QxService : based on QtNetwork engine of Qt library, this module provides an easy and powerful way to create C++ application server (services concept with request from client and reply from server). QxService uses serialization and introspection from QxOrm library to transfer over network any class or structure. For more details about QxService module, a tutorial is available here.

- QxCollection<Key, Value> : this thread-safe container has advantages of std::vector<T> (insertion order + quick access by index) and std::unordered_map<Key, Value> or QHash<Key, Value> (quick access by a key : hash-map). QxCollection<Key, Value> is adapted to contain the items resulting from a database.

- QxSerialize : this module is based on Qt QDataStream class. Any class defined by QxOrm can be serialized to binary, XML and JSON format. This module also allows to clone all instances of objects. Most of Qt objects (QObject, QString, QDate, QTime, QDateTime, QList, QHash...) are compatible with QxSerialize module.

- QxTraits : C++ standard library provides several generic traits. QxOrm uses them but needs new functionalities that are not present in std standard library.

- QxCache : QxOrm's cache can contain all types of objects. It's possible for example to store data resulting from a database to avoid too frequent requests. This cache is generic and can be used in other contexts than QxOrm.

- QxValidator : this module provides a validation engine for classes registered in QxOrm context. To use this validation engine, you have to define your constraints into the mapping function per class : void qx::register_class. If for an instance of class, at least one constraint violation is detected, then the instance is invalid : the object cannot be saved into database (INSERT or UPDATE). For more information about QxValidator module, read the manual here.

- QxMemLeak : fast detection of memory leaks in Debug mode (with indication of file and line => MFC style from Microsoft). This module is developed by Wu Yongwei. If another tool is already used in your projects (Valgrind for example), this functionality should not be enabled. By default, QxMemLeak module is disabled.

You can download the current version of QxOrm library and QxEntityEditor application here.
A manual (user guide) to learn how to work with QxOrm library is available here.
A quick sample showing basic functionalities of QxOrm is available here.
If you have any questions about QxOrm library or QxEntityEditor application, a forum is available here.

| � 2011-202XDL Teamty - ic-east.com |