qt5
Last change
on this file since 5a73d27 was
5a73d27,
checked in by komarma <komarma@…>, 13 years ago
|
Adding orm module
|
-
Property mode set to
100644
|
File size:
1.5 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 | // column definition |
---|
22 | enum Column |
---|
23 | { |
---|
24 | Id = 0, |
---|
25 | Conference, |
---|
26 | Start, |
---|
27 | Duration, |
---|
28 | Activity, |
---|
29 | Type, |
---|
30 | Language |
---|
31 | }; |
---|
32 | |
---|
33 | static QStringList const sColNames; |
---|
34 | |
---|
35 | static QString const sTableName; |
---|
36 | |
---|
37 | public: |
---|
38 | static Event getById(int id, int conferenceId) { return Event(); } //EventTable::selectOne("id=1"); } |
---|
39 | |
---|
40 | public: |
---|
41 | int id() const { return value(Id).toInt(); } |
---|
42 | int conferenceId() const { return value(Conference).toInt(); } |
---|
43 | QDateTime start() const { return value(Start).toDateTime(); } |
---|
44 | int duration() const { return value(Duration).toInt(); } |
---|
45 | int activityId() const { return value(Activity).toInt(); } |
---|
46 | int typeId() const { return value(Type).toInt(); } |
---|
47 | int languageId() const { return value(Language).toInt(); } |
---|
48 | |
---|
49 | void setId(int id) { setValue(Id, id); } |
---|
50 | void setConferenceId(int conferenceId) { setValue(Conference, conferenceId); } |
---|
51 | void setStart(const QDateTime& start) { setValue(Start, start); } |
---|
52 | void setDuration(int duration) { setValue(Duration, duration); } |
---|
53 | void setActivityId(int activityId) { setValue(Activity, activityId); } |
---|
54 | void setTypeId(int typeId) { setValue(Type, typeId); } |
---|
55 | void setLanguageId(int languageId) { setValue(Language, languageId); } |
---|
56 | }; |
---|
57 | |
---|
58 | |
---|
59 | |
---|
60 | #endif // EVENT_H |
---|
Note: See
TracBrowser
for help on using the repository browser.