Advertisement
bkuhns

Relation<>

Sep 13th, 2012
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. namespace DB {
  2.  
  3. class Course : public Model {
  4.  
  5. public:
  6.     Course()
  7.         : students_(this),
  8.           instructor_(this)
  9.     {
  10.     }
  11.  
  12.     const std::vector<Student>& getStudents()
  13.     {
  14.         return students_.get();
  15.     }
  16.  
  17.     const Instructor& getInstructor()
  18.     {
  19.         return instructor_.get();
  20.     }
  21.  
  22. private:
  23.     Relation<HasMany, DB::Student>    students_;
  24.     Relation<HasOne,  DB::Instructor> instructor_;
  25.  
  26. };
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement