public Map<String, Double> getAvgSallaryInEachDepartmentCriteria()
	{
		Map<String, Double> avgSallaryInDepartments = new HashMap<>();
		
		CriteriaBuilder builder = manager.getCriteriaBuilder();
		
		CriteriaQuery<Tuple> query = builder.createTupleQuery();
		Root<Department> depRoot = query.from(Department.class);
		Join<Department, Employee> depEmpJoinRoot = depRoot.join("employees");
		
		query.multiselect(depRoot.get("departmentName").alias("departmentName"), builder.avg(depEmpJoinRoot.<Double>get("sallary")).alias("avgSallary")).groupBy(depRoot);
		
		TypedQuery<Tuple> resQuery = manager.createQuery(query); 
		
		List<Tuple> results = resQuery.getResultList();
		
		for (Tuple row : results)
		{
			avgSallaryInDepartments.put((String)row.get("departmentName"), (Double)row.get("avgSallary"));
		}
		
		return avgSallaryInDepartments;
	}