コード例 #1
0
  @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);
  }
コード例 #2
0
  @Override
  public void updateDegree(int degreeId, String degreeType) {

    Degree degree = degreeDao.getDegree(degreeId);
    degree.setType(degreeType);
    // updateDegree Could be used
    degreeDao.saveDegree(degree);
  }
コード例 #3
0
  @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);
  }
コード例 #4
0
ファイル: Degree.java プロジェクト: arnabkd/inf5750
  @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());
  }