qt5
Last change
on this file since 20a6010 was
20a6010,
checked in by komarma <komarma@…>, 13 years ago
|
Adding database loading and data conversion to orm module
|
-
Property mode set to
100644
|
File size:
1.4 KB
|
Line | |
---|
1 | #ifndef EVENT_H |
---|
2 | #define EVENT_H |
---|
3 | |
---|
4 | #include <QDateTime> |
---|
5 | #include <QVector> |
---|
6 | #include <QStringList> |
---|
7 | |
---|
8 | #include <ormrecord.h> |
---|
9 | |
---|
10 | |
---|
11 | /** |
---|
12 | NoSuchEventException is thrown when required event does not exist. |
---|
13 | */ |
---|
14 | class NoSuchEventException |
---|
15 | { |
---|
16 | }; |
---|
17 | |
---|
18 | class Event : public OrmRecord<Event> |
---|
19 | { |
---|
20 | public: |
---|
21 | static QSqlRecord const sColumns; |
---|
22 | static QString const sTableName; |
---|
23 | |
---|
24 | public: |
---|
25 | static Event getById(int id, int conferenceId); |
---|
26 | |
---|
27 | public: |
---|
28 | int id() const { return value("id").toInt(); } |
---|
29 | int conferenceId() const { return value("xid_conference").toInt(); } |
---|
30 | QDateTime start() const { return value("start").toDateTime(); } |
---|
31 | int duration() const { return value("duration").toInt(); } |
---|
32 | int activityId() const { return value("xid_activity").toInt(); } |
---|
33 | int typeId() const { return value("type").toInt(); } |
---|
34 | int languageId() const { return value("language").toInt(); } |
---|
35 | |
---|
36 | void setId(int id) { setValue("id", id); } |
---|
37 | void setConferenceId(int conferenceId) { setValue("xid_conference", conferenceId); } |
---|
38 | void setStart(const QDateTime& start) { setValue("start", start); } |
---|
39 | void setDuration(int duration) { setValue("duration", duration); } |
---|
40 | void setActivityId(int activityId) { setValue("xid_activity", activityId); } |
---|
41 | void setTypeId(int typeId) { setValue("type", typeId); } |
---|
42 | void setLanguageId(int languageId) { setValue("language", languageId); } |
---|
43 | |
---|
44 | friend class EventTest; |
---|
45 | }; |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | #endif // EVENT_H |
---|
Note: See
TracBrowser
for help on using the repository browser.