@Override
  public List<Requirement> searchRequirementByName(Requirement requirement) {

    SqlSession sqlSession = getSqlSessionFactory().openSession();
    try {

      RequirementMapper requirementMapper = sqlSession.getMapper(RequirementMapper.class);
      if (requirementMapper.checkIfExistingRequirement(requirement) > 0) {
        return requirementMapper.searchRequirementByName(requirement);
      }

    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
  @Override
  public Requirement readRequirement(Requirement requirement) {

    SqlSession sqlSession = getSqlSessionFactory().openSession();
    try {

      RequirementMapper requirementMapper = sqlSession.getMapper(RequirementMapper.class);
      if (requirementMapper.checkIfExistingRequirement(requirement) > 0) {
        return requirementMapper.selectRequirement(requirement);
      }

    } catch (Exception e) {
      e.printStackTrace();
      sqlSession.rollback();
    } finally {
      sqlSession.close();
    }
    return null;
  }
  @Override
  public String updateRequirement(Requirement requirement) {

    SqlSession sqlSession = getSqlSessionFactory().openSession();
    try {

      RequirementMapper requirementMapper = sqlSession.getMapper(RequirementMapper.class);
      if (requirementMapper.checkIfExistingRequirement(requirement) > 0) {
        requirementMapper.updateRequirement(requirement);
        sqlSession.commit();
        return "success";
      }
      return "failed-does-not-exist";

    } catch (Exception e) {
      e.printStackTrace();
      sqlSession.rollback();
    } finally {
      sqlSession.close();
    }
    return "failed-database";
  }