| QxOrm 1.4.7 C++ Object Relational Mapping library

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

IxPersistable.h
Go to the documentation of this file.

    00001 /****************************************************************************
    00002 **
    00003 ** https://www.qxorm.com/
    00004 ** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
    00005 **
    00006 ** This file is part of the QxOrm library
    00007 **
    00008 ** This software is provided 'as-is', without any express or implied
    00009 ** warranty. In no event will the authors be held liable for any
    00010 ** damages arising from the use of this software
    00011 **
    00012 ** Commercial Usage
    00013 ** Licensees holding valid commercial QxOrm licenses may use this file in
    00014 ** accordance with the commercial license agreement provided with the
    00015 ** Software or, alternatively, in accordance with the terms contained in
    00016 ** a written agreement between you and Lionel Marty
    00017 **
    00018 ** GNU General Public License Usage
    00019 ** Alternatively, this file may be used under the terms of the GNU
    00020 ** General Public License version 3.0 as published by the Free Software
    00021 ** Foundation and appearing in the file 'license.gpl3.txt' included in the
    00022 ** packaging of this file. Please review the following information to
    00023 ** ensure the GNU General Public License version 3.0 requirements will be
    00024 ** met : http://www.gnu.org/copyleft/gpl.html
    00025 **
    00026 ** If you are unsure which license is appropriate for your use, or
    00027 ** if you have questions regarding the use of this file, please contact :
    00028 ** contact@qxorm.com
    00029 **
    00030 ****************************************************************************/
    00031
    00032 #ifndef _IX_PERSISTABLE_H_
    00033 #define _IX_PERSISTABLE_H_
    00034
    00035 #ifdef _MSC_VER
    00036 #pragma once
    00037 #endif
    00038
    00046 #include <QxDao/QxSqlQuery.h>
    00047 #include <QxDao/QxDao.h>
    00048 #include <QxDao/QxSqlSaveMode.h>
    00049
    00050 #include <QxRegister/QxClass.h>
    00051
    00052 #include <QxCollection/QxCollection.h>
    00053
    00054 #include <QxValidator/QxInvalidValueX.h>
    00055 #include <QxValidator/QxValidatorFct.h>
    00056
    00057 #include <QxTraits/get_class_name.h>
    00058
    00059 namespace qx {
    00060
    00061 class IxPersistableCollection;
    00062
    00081 class QX_DLL_EXPORT IxPersistable
    00082 {
    00083
    00084 public:
    00085
    00086    IxPersistable();
    00087    virtual ~IxPersistable();
    00088
    00099    virtual long qxCount(const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()) = 0;
    00100
    00112    virtual QSqlError qxCount(long & lCount, const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()) = 0;
    00113
    00126    virtual QSqlError qxFetchById(const QVariant & id = QVariant(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
    00127
    00141    virtual QSqlError qxFetchAll(qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
    00142
    00157    virtual QSqlError qxFetchByQuery(const qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
    00158
    00169    virtual QSqlError qxInsert(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
    00170
    00183    virtual QSqlError qxUpdate(const qx::QxSqlQuery & query = qx::QxSqlQuery(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL) = 0;
    00184
    00198    virtual QSqlError qxSave(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, qx::dao::save_mode::e_save_mode eSaveRecursiveMode = qx::dao::save_mode::e_none) = 0;
    00199
    00213    virtual QSqlError qxDeleteById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
    00214
    00227    virtual QSqlError qxDeleteAll(QSqlDatabase * pDatabase = NULL) = 0;
    00228
    00242    virtual QSqlError qxDeleteByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL) = 0;
    00243
    00254    virtual QSqlError qxDestroyById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
    00255
    00265    virtual QSqlError qxDestroyAll(QSqlDatabase * pDatabase = NULL) = 0;
    00266
    00277    virtual QSqlError qxDestroyByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL) = 0;
    00278
    00285    virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL) = 0;
    00286
    00294    virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, QSqlDatabase * pDatabase = NULL) = 0;
    00295
    00306    virtual qx_bool qxExist(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL) = 0;
    00307
    00315    virtual qx::QxInvalidValueX qxValidate(const QStringList & groups = QStringList()) = 0;
    00316
    00322    virtual std::shared_ptr<qx::IxPersistableCollection> qxNewPersistableCollection(bool bAsList = false) const = 0;
    00323
    00328    virtual qx::IxClass * qxClass() const = 0;
    00329
    00330 #ifndef _QX_NO_JSON
    00331    virtual QString toJson(const QString & format = QString()) const = 0;
    00332    virtual QJsonValue toJson_(const QString & format = QString()) const = 0;
    00333    virtual qx_bool fromJson(const QString & json, const QString & format = QString()) = 0;
    00334    virtual qx_bool fromJson_(const QJsonValue & json, const QString & format = QString()) = 0;
    00335 #endif // _QX_NO_JSON
    00336
    00337 public:
    00338
    00339    static std::shared_ptr<qx::IxPersistableCollection> qxFetchAll(const QString & className, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, bool bAsList = false);
    00340    static std::shared_ptr<qx::IxPersistableCollection> qxFetchByQuery(const QString & className, const qx::QxSqlQuery & query, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, bool bAsList = false);
    00341    static std::shared_ptr<qx::IxPersistableCollection> qxExecuteQuery(const QString & className, qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL, bool bAsList = false);
    00342
    00343 };
    00344
    00345 typedef std::shared_ptr<qx::IxPersistable> IxPersistable_ptr;
    00346
    00347 } // namespace qx
    00348
    00349 namespace qx {
    00350 namespace trait {
    00351
    00356 template <typename T>
    00357 struct is_ix_persistable
    00358 { enum { value = std::is_base_of<qx::IxPersistable, T>::value }; };
    00359
    00360 } // namespace trait
    00361 } // namespace qx
    00362
    00363 #ifndef _QX_NO_JSON
    00364 #define QX_PERSISTABLE_JSON_HPP(className) \
    00365 virtual QString toJson(const QString & format = QString()) const; \
    00366 virtual QJsonValue toJson_(const QString & format = QString()) const; \
    00367 virtual qx_bool fromJson(const QString & json, const QString & format = QString()); \
    00368 virtual qx_bool fromJson_(const QJsonValue & json, const QString & format = QString());
    00369 #else // _QX_NO_JSON
    00370 #define QX_PERSISTABLE_JSON_HPP(className) /* Nothing */
    00371 #endif // _QX_NO_JSON
    00372
    00373 #define QX_PERSISTABLE_HPP(className) \
    00374 public: \
    00375 virtual long qxCount(const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()); \
    00376 virtual QSqlError qxCount(long & lCount, const qx::QxSqlQuery & query = qx::QxSqlQuery(), QSqlDatabase * pDatabase = NULL, const QStringList & relation = QStringList()); \
    00377 virtual QSqlError qxFetchById(const QVariant & id = QVariant(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
    00378 virtual QSqlError qxFetchAll(qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
    00379 virtual QSqlError qxFetchByQuery(const qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
    00380 virtual QSqlError qxInsert(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
    00381 virtual QSqlError qxUpdate(const qx::QxSqlQuery & query = qx::QxSqlQuery(), const QStringList & columns = QStringList(), const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL); \
    00382 virtual QSqlError qxSave(const QStringList & relation = QStringList(), QSqlDatabase * pDatabase = NULL, qx::dao::save_mode::e_save_mode eSaveRecursiveMode = qx::dao::save_mode::e_none); \
    00383 virtual QSqlError qxDeleteById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL); \
    00384 virtual QSqlError qxDeleteAll(QSqlDatabase * pDatabase = NULL); \
    00385 virtual QSqlError qxDeleteByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \
    00386 virtual QSqlError qxDestroyById(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL); \
    00387 virtual QSqlError qxDestroyAll(QSqlDatabase * pDatabase = NULL); \
    00388 virtual QSqlError qxDestroyByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \
    00389 virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, QSqlDatabase * pDatabase = NULL); \
    00390 virtual QSqlError qxExecuteQuery(qx::QxSqlQuery & query, qx::IxPersistableCollection * list = NULL, QSqlDatabase * pDatabase = NULL); \
    00391 virtual qx_bool qxExist(const QVariant & id = QVariant(), QSqlDatabase * pDatabase = NULL); \
    00392 virtual qx::QxInvalidValueX qxValidate(const QStringList & groups = QStringList()); \
    00393 virtual std::shared_ptr<qx::IxPersistableCollection> qxNewPersistableCollection(bool bAsList = false) const; \
    00394 virtual qx::IxClass * qxClass() const; \
    00395 QX_PERSISTABLE_JSON_HPP(className)
    00396
    00397 #ifdef _QX_NO_RTTI
    00398 #define QX_PERSISTABLE_CAST_COLLECTION(className) \
    00399 if (! list) { return QSqlError(); } \
    00400 qx::QxPersistableCollectionHelper< className >::type_coll * list_typed = static_cast< qx::QxPersistableCollectionHelper< className >::type * >(list);
    00401 #else // _QX_NO_RTTI
    00402 #define QX_PERSISTABLE_CAST_COLLECTION(className) \
    00403 if (! list) { return QSqlError(); } \
    00404 qx::QxPersistableCollectionHelper< className >::type_coll * list_typed = dynamic_cast< qx::QxPersistableCollectionHelper< className >::type * >(list);
    00405 #endif // _QX_NO_RTTI
    00406
    00407 #ifndef _QX_NO_JSON
    00408 #define QX_PERSISTABLE_JSON_CPP(className) \
    00409 QString className::toJson(const QString & format) const { return qx::serialization::json::to_string((* this), 1, format); } \
    00410 QJsonValue className::toJson_(const QString & format) const { return qx::cvt::to_json((* this), format); } \
    00411 qx_bool className::fromJson(const QString & json, const QString & format) { return qx::serialization::json::from_string((* this), json, 1, format); } \
    00412 qx_bool className::fromJson_(const QJsonValue & json, const QString & format) { return qx::cvt::from_json(json, (* this), format); }
    00413 #else // _QX_NO_JSON
    00414 #define QX_PERSISTABLE_JSON_CPP(className) /* Nothing */
    00415 #endif // _QX_NO_JSON
    00416
    00417 #define QX_PERSISTABLE_CPP(className) \
    00418 \
    00419 long className::qxCount(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase, const QStringList & relation) \
    00420 { \
    00421    if (relation.count() == 0) { return qx::dao::count< className >(query, pDatabase); } \
    00422    else { long lCount(0); qx::dao::count_with_relation< className >(lCount, relation, query, pDatabase); return lCount; } \
    00423 } \
    00424 \
    00425 QSqlError className::qxCount(long & lCount, const qx::QxSqlQuery & query, QSqlDatabase * pDatabase, const QStringList & relation) \
    00426 { \
    00427    if (relation.count() == 0) { return qx::dao::count< className >(lCount, query, pDatabase); } \
    00428    else { return qx::dao::count_with_relation< className >(lCount, relation, query, pDatabase); } \
    00429 } \
    00430 \
    00431 QSqlError className::qxFetchById(const QVariant & id, const QStringList & columns, const QStringList & relation, QSqlDatabase * pDatabase) \
    00432 { \
    00433    if (id.isValid()) \
    00434    { \
    00435       qx::IxDataMemberX * pDataMemberX = qx::QxClass< className >::getSingleton()->getDataMemberX(); \
    00436       qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX->getId_WithDaoStrategy() : NULL); \
    00437       if (! pDataMemberId) { qDebug("[QxOrm] problem with 'qxFetchById()' method : '%s'", "data member id not registered"); qAssert(false); } \
    00438       if (! pDataMemberId) { return QSqlError("[QxOrm] problem with 'qxFetchById()' method : 'data member id not registered'", "", QSqlError::UnknownError); } \
    00439       pDataMemberId->fromVariant(this, id, -1, qx::cvt::context::e_database); \
    00440    } \
    00441    QSqlError err; \
    00442    if (relation.count() == 0) { err = qx::dao::fetch_by_id((* this), pDatabase, columns); } \
    00443    else { err = qx::dao::fetch_by_id_with_relation(relation, (* this), pDatabase); } \
    00444    return err; \
    00445 } \
    00446 \
    00447 QSqlError className::qxFetchAll(qx::IxPersistableCollection * list, const QStringList & columns, const QStringList & relation, QSqlDatabase * pDatabase) \
    00448 { \
    00449    QX_PERSISTABLE_CAST_COLLECTION(className) \
    00450    if (! list_typed) { qDebug("[QxOrm] problem with 'qxFetchAll()' method : '%s'", "dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >"); qAssert(false); } \
    00451    if (! list_typed) { return QSqlError("[QxOrm] problem with 'qxFetchAll()' method : 'dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >'", "", QSqlError::UnknownError); } \
    00452    QSqlError err; \
    00453    if (relation.count() == 0) { err = qx::dao::fetch_all((* list_typed), pDatabase, columns); } \
    00454    else { err = qx::dao::fetch_all_with_relation(relation, (* list_typed), pDatabase); } \
    00455    return err; \
    00456 } \
    00457 \
    00458 QSqlError className::qxFetchByQuery(const qx::QxSqlQuery & query, qx::IxPersistableCollection * list, const QStringList & columns, const QStringList & relation, QSqlDatabase * pDatabase) \
    00459 { \
    00460    QX_PERSISTABLE_CAST_COLLECTION(className) \
    00461    if (! list_typed) { qDebug("[QxOrm] problem with 'qxFetchByQuery()' method : '%s'", "dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >"); qAssert(false); } \
    00462    if (! list_typed) { return QSqlError("[QxOrm] problem with 'qxFetchByQuery()' method : 'dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >'", "", QSqlError::UnknownError); } \
    00463    QSqlError err; \
    00464    if (relation.count() == 0) { err = qx::dao::fetch_by_query(query, (* list_typed), pDatabase, columns); } \
    00465    else { err = qx::dao::fetch_by_query_with_relation(relation, query, (* list_typed), pDatabase); } \
    00466    return err; \
    00467 } \
    00468 \
    00469 QSqlError className::qxInsert(const QStringList & relation, QSqlDatabase * pDatabase) \
    00470 { \
    00471    QSqlError err; \
    00472    if (relation.count() == 0) { err = qx::dao::insert((* this), pDatabase); } \
    00473    else { err = qx::dao::insert_with_relation(relation, (* this), pDatabase); } \
    00474    return err; \
    00475 } \
    00476 \
    00477 QSqlError className::qxUpdate(const qx::QxSqlQuery & query, const QStringList & columns, const QStringList & relation, QSqlDatabase * pDatabase) \
    00478 { \
    00479    QSqlError err; \
    00480    if (relation.count() == 0) { err = qx::dao::update_by_query(query, (* this), pDatabase, columns); } \
    00481    else { err = qx::dao::update_by_query_with_relation(relation, query, (* this), pDatabase); } \
    00482    return err; \
    00483 } \
    00484 \
    00485 QSqlError className::qxSave(const QStringList & relation, QSqlDatabase * pDatabase, qx::dao::save_mode::e_save_mode eSaveRecursiveMode) \
    00486 { \
    00487    QSqlError err; \
    00488    if (eSaveRecursiveMode != qx::dao::save_mode::e_none) { err = qx::dao::save_with_relation_recursive((* this), eSaveRecursiveMode, pDatabase); } \
    00489    else if (relation.count() == 0) { err = qx::dao::save((* this), pDatabase); } \
    00490    else { err = qx::dao::save_with_relation(relation, (* this), pDatabase); } \
    00491    return err; \
    00492 } \
    00493 \
    00494 QSqlError className::qxDeleteById(const QVariant & id, QSqlDatabase * pDatabase) \
    00495 { \
    00496    if (id.isValid()) \
    00497    { \
    00498       qx::IxDataMemberX * pDataMemberX = qx::QxClass< className >::getSingleton()->getDataMemberX(); \
    00499       qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX->getId_WithDaoStrategy() : NULL); \
    00500       if (! pDataMemberId) { qDebug("[QxOrm] problem with 'qxDeleteById()' method : '%s'", "data member id not registered"); qAssert(false); } \
    00501       if (! pDataMemberId) { return QSqlError("[QxOrm] problem with 'qxDeleteById()' method : 'data member id not registered'", "", QSqlError::UnknownError); } \
    00502       pDataMemberId->fromVariant(this, id, -1, qx::cvt::context::e_database); \
    00503    } \
    00504    return qx::dao::delete_by_id((* this), pDatabase); \
    00505 } \
    00506 \
    00507 QSqlError className::qxDeleteAll(QSqlDatabase * pDatabase) \
    00508 { \
    00509    return qx::dao::delete_all< className >(pDatabase); \
    00510 } \
    00511 \
    00512 QSqlError className::qxDeleteByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase) \
    00513 { \
    00514    return qx::dao::delete_by_query< className >(query, pDatabase); \
    00515 } \
    00516 \
    00517 QSqlError className::qxDestroyById(const QVariant & id, QSqlDatabase * pDatabase) \
    00518 { \
    00519    if (id.isValid()) \
    00520    { \
    00521       qx::IxDataMemberX * pDataMemberX = qx::QxClass< className >::getSingleton()->getDataMemberX(); \
    00522       qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX->getId_WithDaoStrategy() : NULL); \
    00523       if (! pDataMemberId) { qDebug("[QxOrm] problem with 'qxDestroyById()' method : '%s'", "data member id not registered"); qAssert(false); } \
    00524       if (! pDataMemberId) { return QSqlError("[QxOrm] problem with 'qxDestroyById()' method : 'data member id not registered'", "", QSqlError::UnknownError); } \
    00525       pDataMemberId->fromVariant(this, id, -1, qx::cvt::context::e_database); \
    00526    } \
    00527    return qx::dao::destroy_by_id((* this), pDatabase); \
    00528 } \
    00529 \
    00530 QSqlError className::qxDestroyAll(QSqlDatabase * pDatabase) \
    00531 { \
    00532    return qx::dao::destroy_all< className >(pDatabase); \
    00533 } \
    00534 \
    00535 QSqlError className::qxDestroyByQuery(const qx::QxSqlQuery & query, QSqlDatabase * pDatabase) \
    00536 { \
    00537    return qx::dao::destroy_by_query< className >(query, pDatabase); \
    00538 } \
    00539 \
    00540 QSqlError className::qxExecuteQuery(qx::QxSqlQuery & query, QSqlDatabase * pDatabase) \
    00541 { \
    00542    return qx::dao::execute_query(query, (* this), pDatabase); \
    00543 } \
    00544 \
    00545 QSqlError className::qxExecuteQuery(qx::QxSqlQuery & query, qx::IxPersistableCollection * list, QSqlDatabase * pDatabase) \
    00546 { \
    00547    QX_PERSISTABLE_CAST_COLLECTION(className) \
    00548    if (! list_typed) { qDebug("[QxOrm] problem with 'qxExecuteQuery()' method : '%s'", "dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >"); qAssert(false); } \
    00549    if (! list_typed) { return QSqlError("[QxOrm] problem with 'qxExecuteQuery()' method : 'dynamic_cast failed using collection qx::QxCollection< type_primary_key, std::shared_ptr<type> >'", "", QSqlError::UnknownError); } \
    00550    return qx::dao::execute_query(query, (* list_typed), pDatabase); \
    00551 } \
    00552 \
    00553 qx_bool className::qxExist(const QVariant & id, QSqlDatabase * pDatabase) \
    00554 { \
    00555    if (id.isValid()) \
    00556    { \
    00557       qx::IxDataMemberX * pDataMemberX = qx::QxClass< className >::getSingleton()->getDataMemberX(); \
    00558       qx::IxDataMember * pDataMemberId = (pDataMemberX ? pDataMemberX->getId_WithDaoStrategy() : NULL); \
    00559       if (! pDataMemberId) { qDebug("[QxOrm] problem with 'qxExist()' method : '%s'", "data member id not registered"); qAssert(false); } \
    00560       if (! pDataMemberId) { return qx_bool(false); } \
    00561       pDataMemberId->fromVariant(this, id, -1, qx::cvt::context::e_database); \
    00562    } \
    00563    return qx::dao::exist((* this), pDatabase); \
    00564 } \
    00565 \
    00566 qx::QxInvalidValueX className::qxValidate(const QStringList & groups) \
    00567 { \
    00568    return qx::validate((* this), groups); \
    00569 } \
    00570 \
    00571 std::shared_ptr<qx::IxPersistableCollection> className::qxNewPersistableCollection(bool bAsList) const \
    00572 { \
    00573    if (bAsList) { std::shared_ptr<qx::IxPersistableCollection> coll = std::make_shared<qx::QxPersistableList< className > >(); return coll; } \
    00574    else { std::shared_ptr<qx::IxPersistableCollection> coll = std::make_shared<qx::QxPersistableCollectionHelper< className >::type>(); return coll; } \
    00575 } \
    00576 \
    00577 qx::IxClass * className::qxClass() const \
    00578 { \
    00579    return qx::QxClass< className >::getSingleton(); \
    00580 } \
    00581 \
    00582 QX_PERSISTABLE_JSON_CPP(className)
    00583
    00584 QX_REGISTER_CLASS_NAME(qx::IxPersistable)
    00585
    00586 #include <QxDao/IxPersistableCollection.h>
    00587
    00588 #endif // _IX_PERSISTABLE_H_