String q = "select scoreEntry.department.id, scoreEntry.department.name, scoreEntry.yearMonth, sum(scoreEntry.score) " +
"from ScoreEntry scoreEntry " +
"where scoreEntry.yearMonth >= :startMonth and scoreEntry.yearMonth <= :endMonth " +
"group by scoreEntry.department.id, scoreEntry.department.name, scoreEntry.yearMonth";