H
hepower
Guest
hello everyone,
I have a many-to-many relation ship between table Teacher & table Student, details as below:
we have 'students' and 'teachers' list in these 2 domain classes, my question is that , when I tried to generated the controller and views using 'generate-all' command, how to show the list information?
like when i click 1 specific student or teacher information in student->show or teacher->show, how can I see the students belongs to a specific teacher or the teachers which related to a student?
I mean the 'students' and 'teachers' seems empty.
thanks.
I have a many-to-many relation ship between table Teacher & table Student, details as below:
Code:
class Student {
String name
String age
static hasMany = [teachers: Teacher]
static constraints = {
}
static belongsTo = [Teacher]
static mapping = {
cache true
}
}
package dbtest
class Teacher {
String name
String major
static hasMany = [students: Student]
static constraints = {
}
static mapping = {
cache true
}
}
we have 'students' and 'teachers' list in these 2 domain classes, my question is that , when I tried to generated the controller and views using 'generate-all' command, how to show the list information?
like when i click 1 specific student or teacher information in student->show or teacher->show, how can I see the students belongs to a specific teacher or the teachers which related to a student?
I mean the 'students' and 'teachers' seems empty.
thanks.