2

I'm creating NamedQueries in my Entity, like this:

@NamedQueries(value = {
        @NamedQuery(name = "Banca.findByNome", query = "SELECT c FROM Banca c WHERE " +
                "upper(c.nome) like upper(:nome) || '%'")})

This works normal in Runtime but show error DesignTime (ECLIPSE IDE), see:

The expression is not a valid conditional expression.

I know that sintaxe error is because some operators don't exist in JPQL, just in HQL. I'm using HQL and not JPQL, and i would like that IDE understand that i'm not using JPQL and stop show error.

Shelly
  • 1,035
  • 5
  • 27
  • 51
  • 1
    I cannot understand what you want with this query. Can you explain? This query `SELECT c FROM Banca c WHERE upper(c.nome) like upper(:nome) || '%'` is incorrect. You cannot use this "concat" (`||`) operator in a JPQL/HQL and, even if was possible, I continue to not understand your objective. Maybe, you want: `SELECT c FROM Banca c WHERE upper(c.nome) like upper(:nome%)` – Dherik Nov 23 '15 at 15:34
  • In case of system being turkish language, check out this: https://stackoverflow.com/a/55657143/1382345 – Noman_1 Jan 27 '21 at 11:15

0 Answers0