Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace DB {
- class Course : public Model {
- public:
- Course()
- : students_(this),
- instructor_(this)
- {
- }
- const std::vector<Student>& getStudents()
- {
- return students_.get();
- }
- const Instructor& getInstructor()
- {
- return instructor_.get();
- }
- private:
- Relation<HasMany, DB::Student> students_;
- Relation<HasOne, DB::Instructor> instructor_;
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement