QxOrm
1.5.0
C++ Object Relational Mapping library
|
Common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros. More...
#include <QxDao/QxSqlQuery.h>
#include <QxDao/QxDao.h>
#include <QxDao/QxSqlSaveMode.h>
#include <QxRegister/QxClass.h>
#include <QxCollection/QxCollection.h>
#include <QxValidator/QxInvalidValueX.h>
#include <QxValidator/QxValidatorFct.h>
#include <QxTraits/get_class_name.h>
#include <QxDao/IxPersistableCollection.h>
Go to the source code of this file.
Classes | |
class | qx::IxPersistable |
qx::IxPersistable : common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros More... | |
struct | qx::trait::is_ix_persistable< T > |
qx::trait::is_ix_persistable<T>::value : return true if T implements qx::IxPersistable interface, otherwise return false More... | |
Namespaces | |
namespace | qx |
Root namespace for all QxOrm library features. | |
namespace | qx::trait |
QxOrm library traits (template metaprogramming) not available in boost::type_traits library. | |
Defines | |
#define | QX_PERSISTABLE_JSON_HPP(className) |
#define | QX_PERSISTABLE_HPP(className) |
#define | QX_PERSISTABLE_CAST_COLLECTION(className) |
#define | QX_PERSISTABLE_JSON_CPP(className) |
#define | QX_PERSISTABLE_CPP(className) |
Typedefs | |
typedef std::shared_ptr < qx::IxPersistable > | qx::IxPersistable_ptr |
Common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros.
Definition in file IxPersistable.h.
#define QX_PERSISTABLE_CAST_COLLECTION | ( | className | ) |
if (! list) { return QSqlError(); } \ qx::QxPersistableCollectionHelper< className >::type_coll * list_typed = dynamic_cast< qx::QxPersistableCollectionHelper< className >::type * >(list);
Definition at line 406 of file IxPersistable.h.
#define QX_PERSISTABLE_CPP | ( | className | ) |
Definition at line 421 of file IxPersistable.h.
#define QX_PERSISTABLE_HPP | ( | className | ) |
public: \ virtual long qxCount(const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()); \ virtual QSqlError qxCount(long & lCount, const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()); \ virtual QSqlError qxFetchById(const QVariant & id = QVariant(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxFetchAll(qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxFetchByQuery(const qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxInsert(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, bool bUseExecBatch = false); \ virtual QSqlError qxUpdate(const qx::QxSqlQuery & query = qx::QxSqlQuery(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, bool bUseExecBatch = false); \ virtual QSqlError qxSave(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, qx::dao::save_mode::e_save_mode eSaveRecursiveMode = qx::dao::save_mode::e_none); \ virtual QSqlError qxDeleteById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL, bool bUseExecBatch = false); \ virtual QSqlError qxDeleteAll(QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxDeleteByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxDestroyById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL, bool bUseExecBatch = false); \ virtual QSqlError qxDestroyAll(QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxDestroyByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \ virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, QSqlDatabase * pDatabase = NULL); \ virtual qx_bool qxExist(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL); \ virtual qx::QxInvalidValueX qxValidate(const QStringList & groups = QStringList()); \ virtual std::shared_ptr<qx::IxPersistableCollection> qxNewPersistableCollection(bool bAsList = false) const; \ virtual qx::IxClass * qxClass() const; \ QX_PERSISTABLE_JSON_HPP(className)
Definition at line 377 of file IxPersistable.h.
#define QX_PERSISTABLE_JSON_CPP | ( | className | ) |
QString className::toJson(const QString & format) const { return qx::serialization::json::to_string((* this), 1, format); } \ QJsonValue className::toJson_(const QString & format) const { return qx::cvt::to_json((* this), format); } \ qx_bool className::fromJson(const QString & json, const QString & format) { return qx::serialization::json::from_string((* this), json, 1, format); } \ qx_bool className::fromJson_(const QJsonValue & json, const QString & format) { return qx::cvt::from_json(json, (* this), format); }
Definition at line 412 of file IxPersistable.h.
#define QX_PERSISTABLE_JSON_HPP | ( | className | ) |
virtual QString toJson(const QString & format = QString()) const; \ virtual QJsonValue toJson_(const QString & format = QString()) const; \ virtual qx_bool fromJson(const QString & json, const QString & format = QString()); \ virtual qx_bool fromJson_(const QJsonValue & json, const QString & format = QString());
Definition at line 368 of file IxPersistable.h.