Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SqlQuery with named parameter and limit/offset gives SQL exception #746

Closed
rbygrave opened this issue Jun 20, 2016 · 0 comments
Closed

SqlQuery with named parameter and limit/offset gives SQL exception #746

rbygrave opened this issue Jun 20, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@rbygrave
Copy link
Member

Steps to reproduce

String sql = "select * from o_order where o_order.id > :id order by id ";

SqlQuery sqlQuery = Ebean.createSqlQuery(sql);
sqlQuery.setParameter("id", 3);
sqlQuery.setMaxRows(10);
sqlQuery.findList();
javax.persistence.PersistenceException: Query threw SQLException:Syntax error in SQL statement "SELECT * FROM O_ORDER WHERE O_ORDER.ID > :[*]ID ORDER BY ID  LIMIT 10 "; expected "ALL, ANY, SOME, SELECT, FROM"; SQL statement:
select * from o_order where o_order.id > :id order by id  limit 10 [42001-189] Query was:
select * from o_order where o_order.id > :id order by id  limit 10



    at com.avaje.ebeaninternal.server.query.DefaultRelationalQueryEngine.findList(DefaultRelationalQueryEngine.java:87)
    at com.avaje.ebeaninternal.server.core.RelationalQueryRequest.findList(RelationalQueryRequest.java:102)...
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
@rbygrave rbygrave added the bug label Jun 20, 2016
@rbygrave rbygrave added this to the 7.14.2 milestone Jun 20, 2016
@rbygrave rbygrave self-assigned this Jun 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant