You need:
in hibernate.cfg.xml
Code:
<property name="hibernate.connection.url">jdbc:mysql://hostname/schemaname?useServerPrepStmts=false</property>
doing the query, something like this
(final MAX_PAGE_RESULT = 200 or configurable or whatever you need,
nPage = the page you want to view begining with 0,)
Code:
session.createQuery(hql)
.setMaxResults(MAX_PAGE_RESULT)
.setFirstResult(nPage * MAX_PAGE_RESULT)
.list();
or
Code:
session.createQuery(hql)
.setMaxResults(MAX_PAGE_RESULT)
.setFirstResult(nPage * MAX_PAGE_RESULT + 1)
.list();
I don't remember.