I've two named queries in my project that aren't with errors (it works when running) but IntelliJ IDEA shows some errors.
The first is at the last line of the above query. It says "Type mismatch: number type expected", pc.dataPrevisao is a DATE field. Why IDEA says it's an error if it works?
query="select ep from EstoqueProgramado ep " +
"join ep.DI di join di.pedidosCompra pc " +
"where coalesce(ep.produto.familia.mostrarSite, 'S') <> 'N' and " +
" ep.quantidade > 0 and " +
" pc.dataPrevisao between CURRENT_DATE and :dataPrevista"
The second is in this order by "order by pc.dataPrevisao, di.programado, ep.produto, ep.cor", it says "Orderable attribute of the entity been selected expected" on ep.produto and ep.cor. Both are entities that implements Comparable so they are "orderable".
Is this a bug? How could I solve this?