home / blog

SQLite with Hibernate/JPA LIMIT not working [solved]

Couldn’t get setMaxResults() / setFirstResult() to work properly in SQLite with Hibernate / JPA2. These ultimately boil down to SQL LIMIT/OFFSET. After much debug I found there is a problem in the widely distributed SQLiteDialect.java source.

The following needed adding, checkout the method name, code smell!

public boolean bindLimitParametersInReverseOrder() {
    return true;
This entry was posted in geek and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published.