This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I am using javax.persistence.EntityManager to query my table. My query.getResultList() works perfectly when using setFirstResult method, but when I use setMaxResults method, it produces the following error:
When I checked the actual query the limit keyword is placed right after the SELECT keyword, it should be after the statement. Why is the entityManager producing incorrect statement? I am currently using MySQLDialect. I also tried MySQLMyISAMDialect and MySQLInnoDBDialect, but it didn't work as well.
Any input is highly regarded.
Joined: Feb 21, 2011
After double checking my config file, hibernate.dialect was set to "org.hibernate.dialect.HSQLDialect".