Support #697
closedRepresent extra attributes in many-to-many relation in Dbo
0%
Description
How do i add extra attributes on many-to-many relation in Dbo.
for example: how do i represent this relation
Student(student_id,student_name,...)
Grade(grade_id,grade_name,...)
StudyYear(study_year_id,study_year_name,...)
StudentGradeRel(student_id,grade_id,study_year_id,student_number,offDays,...)
Updated by Koen Deforche almost 14 years ago
Hey,
That is indeed not possible using a Many-to-Many relation.
In this case you will need to explicitly model the link table using two Many-to-One relations ?
Regards,
koen
Updated by omair geetan almost 14 years ago
you mean for example:
Student 1:M StudentGradeRel
Grade 1:M StudentGradeRel
StudyYear 1:M StudentGradeRel
i know it can be done like that,
but how do i perform this query (in Dbo not in Sql)
all students in grade X and StudyYear Y,
Updated by Koen Deforche almost 14 years ago
- Status changed from New to Resolved
Hey,
You really should use SQL for that query:
Students students = session.query< dbo::ptr<Student> >("select s from Student join StudentGradeRel r on s.student_id = r.gradien_id ...").where("...");
Regards,
koen
Updated by Koen Deforche almost 14 years ago
- Status changed from Resolved to Closed