Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Execution exception
- [MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nulls last limit 10 offset 0' at line 1]
- def list(page: Int = 0, pageSize: Int = 10, orderBy: Int = 1, filter: String = "%"): Page[(Computer, Option[Company])] = {
- val offest = pageSize * page
- DB.withConnection { implicit connection =>
- val computers = SQL(
- """
- select * from computer
- left join company on computer.company_id = company.id
- where computer.name like {filter}
- order by {orderBy} nulls last
- limit {pageSize} offset {offset}
- """
- ).on(
- 'pageSize -> pageSize,
- 'offset -> offest,
- 'filter -> filter,
- 'orderBy -> orderBy
- ).as(Computer.withCompany *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement