コード例 #1
0
  @Override
  public void removeAttendantFromCourse(int courseId, int studentId) {

    Course course = courseDao.getCourse(courseId);
    Student student = studentDao.getStudent(studentId);
    student.getCourses().remove(course);
    studentDao.saveStudent(student);
  }
コード例 #2
0
  @Override
  public void addAttendantToCourse(int courseId, int studentId) {

    Course course = courseDao.getCourse(courseId);
    Student student = studentDao.getStudent(studentId);
    student.getCourses().add(course);
    studentDao.saveStudent(student);
  }