I'm running some simple MYSQL statements from within a Java application. I'm getting a syntax error on a statement that seems to run fine if I run it directly against the MYSQL server through Navicat. The statement that is giving me hassle is:
@NamedQuery(name = "Image.findDefaultByTest", query = "SELECT i FROM Image i where (i.test_id = :test) LIMIT 0,1")
The error I get is:
Syntax error parsing the query [Image.findDefaultByTest: SELECT i FROM Image i where (i.test_id = :test) LIMIT 0,1], line 1, column 48: syntax error at [LIMIT].
Just to give an example of a statement on the line above that does work:
@NamedQuery(name = "Image.findByLocation", query = "SELECT i FROM Image i WHERE i.location = :location")
Any help on this matter would be much appreciated, the only information I can find on this through Google appears to be from 2003!