my code: Query query = ebeanServer.createQuery(wjw.ebean.dao.Log4jEdi.class); query.setQuery("find Log4jEdi where logLevel like :A and logThread=:B limit 100 offset 3"); query.setParameter("A","INF%"); query.setParameter("B","TPool-7");
List list = query .setFirstRow(3) .findList(); System.out.println(list);
Exception:INFO: Ebean Version[2.1.0-20090914] Java Version[1.6.0_12]javax.persistence.PersistenceException: Query expected 'join', 'where','order by' or 'limit' keyword but got [3] find Log4jEdi where logLevel like :A and logThread=:B limit 100 offset 3 at com.avaje.ebean.server.querydefn.OrmQueryDetailParser.process(OrmQueryDetailParser.java:67) at com.avaje.ebean.server.querydefn.OrmQueryDetailParser.processInitial(OrmQueryDetailParser.java:48) at com.avaje.ebean.server.querydefn.OrmQueryDetailParser.parse(OrmQueryDetailParser.java:29) at com.avaje.ebean.server.querydefn.DefaultOrmQuery.setQuery(DefaultOrmQuery.java:603) at com.avaje.ebean.server.querydefn.DefaultOrmQuery.setQuery(DefaultOrmQuery.java:41) at wjw.ebean.test.TestB.findUseSetQuery2(TestB.java:50) at wjw.ebean.test.TestB.main(TestB.java:66)
Thanks, I have reproduced as a Testcase. Investigating now.
Fixed in HEAD.
Issue was with the OrmQueryDetailParser.
The limit value was bigger than it needed to be. Had no effect on the query result as max limit hit and extra results not read but less efficient queries where being produced.