I have a very simple query with pagination like this
Query query = em.createQuery(ql); query.setFirstResult(currentPage * itemsPerPage);//start rows query.setMaxResults(itemsPerPage);//return rows query.setParameter("searchValue", searchValue);//search criteria return query.getResultList();
select ... from table where ... limit 30, 10
Caused by: java.sql.SQLException: You have an error in your SQL syntax; check the manual that correspondsto your MySQL server version for the right syntax to use near 'limit 15 15 customer0_.ID as ID13_, customer0_.address as address13_, c ustomer0_' at line 1
this is a jdbc drivers bug, try to search in this area