Suppose I have such a request

@Query("select avg(ev.evaluation) from Evaluation ev group by ev.studentId") public List<Integer> listAvgEvaluationByStudentId(); 

A sample of the average ball is made with grouping by student's id.

But besides the score itself, I need to fasten the student's id to it, the request will look like this.

 @Query("select ev.studentId, avg(ev.evaluation) from Evaluation ev group by ev.studentId") public ... listAvgEvaluationByStudentId(); 

I can not only understand what type will return and what to wrap the incoming data. Help with the type of the returned result.

    1 answer 1

    Returns a list of arrays of objects - List<Object[]> .

    • That's right. Thank you. - Artyom Bondarev