@Override
  public void removeRequiredCourseFromDegree(int degreeId, int courseId) {

    Degree degree = degreeDao.getDegree(degreeId);
    Course course = courseDao.getCourse(courseId);
    degree.getRequiredCourses().remove(course);
    degreeDao.saveDegree(degree);
  }
  @Override
  public void updateDegree(int degreeId, String degreeType) {

    Degree degree = degreeDao.getDegree(degreeId);
    degree.setType(degreeType);
    // updateDegree Could be used
    degreeDao.saveDegree(degree);
  }
  @Override
  public void addRequiredCourseToDegree(int degreeId, int courseId) {

    Degree degree = degreeDao.getDegree(degreeId);
    Course course = courseDao.getCourse(courseId);
    degree.getRequiredCourses().add(course);
    degreeDao.saveDegree(degree);
  }
Exemplo n.º 4
0
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }

    if (o == null) {
      return false;
    }

    if (!(o instanceof Degree)) {
      return false;
    }

    final Degree other = (Degree) o;

    return type.equals(other.getType());
  }