0

I am attempting to return a single object via castor query that has the earliest date.

This is the sort of thing I have been trying: SELECT p FROM model.objects.Product p LIMIT $1 WHERE p.status=$2 ORDER BY p.statusDate;

This results in: org.exolab.castor.jdo.oql.OQLSyntaxException: An incorrect token type was found near WHERE (found KEYWORD_WHERE, but expected END_OF_QUERY

I am using version 0.9.6 which I believe supports this kind of thing.

Any hints or pointers much appreciated.

cemlo
  • 135
  • 1
  • 11

1 Answers1

0

As per my comment, it indeed appears that the LIMIT clause must appear after the ORDER BY clause. See the Castor query syntax.

Nathan Ryan
  • 12,893
  • 4
  • 26
  • 37
  • Thanks, it works :).I had tried this but query failed from me leaving ; at the end of the query. I finally picked up on this. – cemlo Nov 24 '12 at 01:14