19 static QString ClassName ()
26 return std::tie (ID_,
Name_);
43 static QString ClassName ()
50 return std::tie (ID_, StudentID_, Age_, Year_);
67 static QString ClassName ()
74 return std::tie (ID_,
Name_);
84 struct Student2Lecturer
90 static QString ClassName ()
92 return "Student2Lecturer";
97 return std::tie (ID_, StudentID_, LecturerID_);
112 void OralFKeyTest::testBasicFKeys ()
116 auto student = Util::oral::AdaptPtr<Student, OralFactory> (db);
117 auto studentInfo = Util::oral::AdaptPtr<StudentInfo, OralFactory> (db);
121 { { 0,
"Student 1" }, { 0, 0, 18, 1 } },
122 { { 0,
"Student 2" }, { 0, 0, 19, 1 } },
123 { { 0,
"Student 3" }, { 0, 0, 19, 2 } },
126 for (
auto& [stud, info] : list)
128 student->Insert (stud);
129 info.StudentID_ = stud.ID_;
130 studentInfo->Insert (info);
133 namespace sph = oral::sph;
135 const auto& selected = student->Select (sph::f<&Student::ID_> == sph::f<&StudentInfo::StudentID_> &&
136 sph::f<&StudentInfo::Age_> > 18);
138 QCOMPARE (selected, expected);