Entry.h 723 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This may look like C code, but it's really -*- C++ -*-
  2. /*
  3. * Copyright (C) 2008 Emweb bvba, Heverlee, Belgium.
  4. *
  5. * See the LICENSE file for terms of use.
  6. */
  7. #ifndef ENTRY_H_
  8. #define ENTRY_H_
  9. #include <Wt/WDateTime>
  10. #include <Wt/Dbo/Dbo>
  11. #include <Wt/Dbo/WtSqlTraits>
  12. class UserAccount;
  13. namespace dbo = Wt::Dbo;
  14. class Entry {
  15. public:
  16. dbo::ptr<UserAccount> user;
  17. Wt::WDateTime start;
  18. Wt::WDateTime stop;
  19. Wt::WString summary;
  20. Wt::WString text;
  21. template<class Action>
  22. void persist(Action& a)
  23. {
  24. dbo::belongsTo(a, user, "user");
  25. dbo::field(a, start, "start");
  26. dbo::field(a, stop, "stop");
  27. dbo::field(a, summary, "summary");
  28. dbo::field(a, text, "text");
  29. }
  30. };
  31. #endif //ENTRY_H_