QxOrm  1.4.5
C++ Object Relational Mapping library

Common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros. More...

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

Detailed Description

Common interface (abstract class) for persistents classes using QX_PERSISTABLE_HPP() and QX_PERSISTABLE_CPP() macros.

Author:
Lionel Marty

Definition in file IxPersistable.h.


Define Documentation

#define QX_PERSISTABLE_CAST_COLLECTION (   className)
Value:
if (! list) { return QSqlError(); } \
qx::QxPersistableCollectionHelper< className >::type_coll * list_typed = dynamic_cast< qx::QxPersistableCollectionHelper< className >::type * >(list);

Definition at line 393 of file IxPersistable.h.

#define QX_PERSISTABLE_CPP (   className)

Definition at line 406 of file IxPersistable.h.

#define QX_PERSISTABLE_HPP (   className)
Value:
public: \
virtual long qxCount(const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL); \
virtual QSqlError qxCount(long & lCount, const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL); \
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); \
virtual QSqlError qxUpdate(const qx::QxSqlQuery & query = qx::QxSqlQuery(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
virtual QSqlError qxSave(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
virtual QSqlError qxDeleteById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL); \
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); \
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() const; \
virtual qx::IxClass * qxClass() const; \
QX_PERSISTABLE_JSON_HPP(className)

Definition at line 364 of file IxPersistable.h.

#define QX_PERSISTABLE_JSON_CPP (   className)
Value:
QString className::toJson(const QString & format) const { return qx::serialization::json::to_string((* this), 1, format); } \
qx_bool className::fromJson(const QString & json, const QString & format) { return qx::serialization::json::from_string((* this), json, 1, format); }

Definition at line 399 of file IxPersistable.h.

#define QX_PERSISTABLE_JSON_HPP (   className)
Value:
virtual QString toJson(const QString & format = QString()) const; \
virtual qx_bool fromJson(const QString & json, const QString & format = QString());

Definition at line 357 of file IxPersistable.h.