private ArrayList<Bean> setCourseInstitutionRelation(Course course, Institution institution) throws ClassNotFoundException, SQLException{
		ArrayList<Bean> beans = new ArrayList<Bean>();
		boolean courseAlreadyExists = Course.alreadyExistsWith("name", course.getName());
		boolean institutionAlreadyExists = Institution.alreadyExistsWith("acronym", institution.getAcronym());

		if(!courseAlreadyExists && !institutionAlreadyExists){
			course.save();
			institution.save();

			institution.addCourse(course);

			beans.add(course);
			beans.add(institution);
		} else if(courseAlreadyExists && !institutionAlreadyExists){
			course = Course.getWhere("name", course.getName(), false).get(0);

			institution.save();

			institution.addCourse(course);

			beans.add(course);
			beans.add(institution);
		} else if(institutionAlreadyExists && !courseAlreadyExists){
			institution = Institution.getWhere("acronym", institution.getAcronym(), false).get(0);

			course.save();

			course.addInstitution(institution);

			beans.add(course);
			beans.add(institution);
		} else { // already has course and institution saved on the database
			course = Course.getWhere("name", course.getName(), false).get(0);
			institution = Institution.getWhere("acronym", institution.getAcronym(), false).get(0);

			if(!course.hasInstitution(institution))
				course.addInstitution(institution); // Add a new relation if it's course doesn't have it

			beans.add(course);
			beans.add(institution);
		}

		return beans;
	}