I’m using eclipse indigo and am having “JPA Validation Problems”.
My named query is:
from Person p where p.name = :name
and there is this error:
The query does not start with a valid identifier, has to be either SELECT, UPDATE or DELETE FROM.
But it’s a valid JPQL query. Somebody know how I can remove this error?
If I change my query to
select p from Person p where p.name = :name
there is no more error, but I do not want to change all my queries.
thanks
mp5
It looks to me like any queries that are of the form:
Are not in fact valid JPQL. According to the language reference at:
http://docs.oracle.com/javaee/5/tutorial/doc/bnbuf.html
each statement needs to have either a
SELECT,UPDATEorDELETEstatement preceding theFROMportion.Here are more examples:
http://en.wikipedia.org/wiki/Java_Persistence_Query_Language
Unfortunately, it looks like you need to update all the queries to make them fit this format.