1 #ifndef USER_H
2 #define USER_H
3 
4 #include <string>
5 #include <Wt/Dbo/Dbo.h>
6 #include <Wt/Auth/Dbo/AuthInfo.h>
7 
8 class User;
9 typedef Wt::Auth::Dbo::AuthInfo<User> AuthInfo;
10 
11 class User
12 {
13 public:
14   std::string name;
15   std::string streetAddress;
16   std::string locality;
17   Wt::Dbo::weak_ptr<AuthInfo> authInfo;
18 
persist(Action & a)19   template<typename Action> void persist(Action& a)
20   {
21     Wt::Dbo::field(a, name, "name");
22     Wt::Dbo::field(a, streetAddress, "street_address");
23     Wt::Dbo::field(a, locality, "locality");
24     Wt::Dbo::hasOne(a, authInfo, "user");
25   }
26 };
27 
28 DBO_EXTERN_TEMPLATES(User)
29 
30 #endif // USER_H
31