#ifndef _QX_PERSISTABLE_H_
#define _QX_PERSISTABLE_H_
#ifdef _MSC_VER
#pragma once
#endif
namespace qx {
class QxPersistable;
namespace dao {
namespace detail {
template <>
struct QxDao_Trigger<qx::QxPersistable>;
}}
class QX_DLL1_EXPORT QxPersistable : public QObject, public qx::IxPersistable
{
Q_OBJECT
QX_REGISTER_FRIEND_CLASS(qx::QxPersistable)
QX_PERSISTABLE_HPP(qx::QxPersistable)
Q_PROPERTY( long qxId READ qxGetId WRITE qxSetId )
Q_PROPERTY( QDateTime qxDateCreation READ qxGetDateCreation WRITE qxSetDateCreation )
Q_PROPERTY( QDateTime qxDateModification READ qxGetDateModification WRITE qxSetDateModification )
friend struct qx::dao::detail::QxDao_Trigger<qx::QxPersistable>;
protected:
long m_qxId; qx::QxDateTimeNeutral m_qxDateCreation; qx::QxDateTimeNeutral m_qxDateModification;
public:
QxPersistable();
virtual ~QxPersistable();
long qxGetId() const;
QDateTime qxGetDateCreation() const;
QDateTime qxGetDateModification() const;
void qxSetId(long l);
void qxSetDateCreation(const QDateTime & dt);
void qxSetDateModification(const QDateTime & dt);
protected:
virtual void qxIsValid(qx::QxInvalidValueX & invalidValues);
virtual void qxOnBeforeInsert(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnBeforeUpdate(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnBeforeDelete(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnBeforeFetch(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnAfterInsert(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnAfterUpdate(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnAfterDelete(qx::dao::detail::IxDao_Helper * dao);
virtual void qxOnAfterFetch(qx::dao::detail::IxDao_Helper * dao);
private:
void qxIsValidInternal(qx::QxInvalidValueX & invalidValues);
Q_SIGNALS:
void qxOnBeforeInsert(qx::QxPersistable * p);
void qxOnBeforeUpdate(qx::QxPersistable * p);
void qxOnBeforeDelete(qx::QxPersistable * p);
void qxOnBeforeFetch(qx::QxPersistable * p);
void qxOnAfterInsert(qx::QxPersistable * p);
void qxOnAfterUpdate(qx::QxPersistable * p);
void qxOnAfterDelete(qx::QxPersistable * p);
void qxOnAfterFetch(qx::QxPersistable * p);
public:
};
typedef boost::shared_ptr<qx::QxPersistable> QxPersistable_ptr;
}
QX_REGISTER_COMPLEX_CLASS_NAME_HPP_QX_DLL1(qx::QxPersistable, QObject, 0, qx_QxPersistable)
namespace qx {
namespace dao {
namespace detail {
template <>
struct QxDao_Trigger<qx::QxPersistable>
{
static inline void onBeforeInsert(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnBeforeInsert(dao); } }
static inline void onBeforeUpdate(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnBeforeUpdate(dao); } }
static inline void onBeforeDelete(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnBeforeDelete(dao); } }
static inline void onBeforeFetch(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnBeforeFetch(dao); } }
static inline void onAfterInsert(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnAfterInsert(dao); } }
static inline void onAfterUpdate(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnAfterUpdate(dao); } }
static inline void onAfterDelete(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnAfterDelete(dao); } }
static inline void onAfterFetch(qx::QxPersistable * t, qx::dao::detail::IxDao_Helper * dao) { if (t) { t->qxOnAfterFetch(dao); } }
};
}}}
#endif // _QX_PERSISTABLE_H_