pointertowhat
Programmer
Hi,
I've got an embedded Derby DB and I use entity beans with namedqueries.
One of which is:
If I use the IDE to send this command to the database it works fine. However when I try and run my application I get:
Any ideas?
I've got an embedded Derby DB and I use entity beans with namedqueries.
One of which is:
Code:
@NamedQuery(name = "Vehicles.findbymotmonth", query = "SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber")
If I use the IDE to send this command to the database it works fine. However when I try and run my application I get:
Code:
...
Exception [TOPLINK-8025] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.EJBQLException
Exception Description: Syntax error parsing the query [Vehicles.findbymotmonth: SELECT v FROM Vehicles v WHERE MONTH(v.lastmotdate) = :monthnumber], line 1, column 32: unexpected token [MONTH].
Internal Exception: line 1:32: unexpected token: MONTH
at oracle.toplink.essentials.exceptions.EJBQLException.unexpectedToken(EJBQLException.java:389)
...
Any ideas?