Nut/test/common/post.h

42 lines
717 B
C++

#ifndef POST_H
#define POST_H
#include <QtCore/qglobal.h>
#include "table.h"
#include "database.h"
#include "databasemodel.h"
#ifdef NUT_NAMESPACE
using namespace NUT_NAMESPACE;
#endif
class Comment;
class Post : public Table
{
Q_OBJECT
NUT_PRIMARY_AUTO_INCREMENT(id)
NUT_DECLARE_FIELD(int, id, id, setId)
NUT_NOT_NULL(title)
NUT_LEN(title, 50)
NUT_DECLARE_FIELD(QString, title, title, setTitle)
NUT_DECLARE_FIELD(QDateTime, saveDate, saveDate, setSaveDate)
NUT_DECLARE_FIELD(QString, body, body, setBody)
NUT_DECLARE_CHILD_TABLE(Comment, comments)
public:
explicit Post(QObject *tableSet = 0);
signals:
public slots:
};
Q_DECLARE_METATYPE(Post*)
#endif // POST_H