/** * @brief Category Model * * @author Adnan "Max13" RIHAN * @link http://rihan.fr/ */ #ifndef CATEGORY_HPP # define CATEGORY_HPP # define QT_SHAREDPOINTER_TRACK_POINTERS # include # include # include # include # include # include # include # include "../BaseModel.hpp" class Category : public BaseModel { Q_OBJECT MODEL_ID_SUPPORT MODEL_NAME_SUPPORT public: Category(QObject *parent = 0); Category(const QString &name, QObject *parent = 0); Category(const Category &other); Category &operator =(const Category &other); bool operator ==(const Category &other) const; bool operator !=(const Category &other) const; virtual bool isNull(void) const; virtual bool isValid(void) const; }; Q_DECLARE_METATYPE(Category) typedef QSharedPointer CategorySP; QDebug &operator <<(QDebug &out, const Category &category); # ifdef ODB_COMPILER # pragma db model version(1, 1, open) # pragma db object(Category) table("categories") # pragma db member(Category::m_id) id auto # pragma db member(Category::m_name) not_null # pragma db member(Category::isDirty) transient # endif #endif // CATEGORY_HPP