Ao declarar o @NamedQuery da média das movimentações na classe Movimentacao, o Eclipse deixou um sinalizador de erro (X) em vermelho, com o texto abaixo:
Multiple markers at this line
- No constructors can be found that match the argument types.
- The GROUP BY clause has 'year' and '(m.data)' that are not separated by a comma.
- The GROUP BY clause has 'month' and '(m.data)' that are not separated by a comma.
- The GROUP BY clause has 'day' and '(m.data)' that are not separated by a comma.
- The identification variable 'month' is not defined in the FROM clause.
- The identification variable 'day' is not defined in the FROM clause.
- The identification variable 'month' is not defined in the FROM clause.
- The identification variable 'day' is not defined in the FROM clause.
- The constructor expression has two constructor items ('month' and '(m.data)') that are not separated by a
comma.
- The constructor expression has two constructor items ('day' and '(m.data)') that are not separated by a
comma.
- The identification variable 'year' is not defined in the FROM clause.
Entretanto, a função para retornar a média funciona utilizando a @NamedQuery. Segue a linha de como eu fiz a declaração:
@NamedQuery(name = "mediaDiariaMovimentacoes", query = "select new br.com.alura.jpa.modelo.MediaComData(avg(m.valor), day(m.data), month(m.data)) from Movimentacao m group by day(m.data), month(m.data), year(m.data) ")
O que pode estar errado? Seria algo do meu Eclipse apenas, já que o Java compilou e rodou normalmente?