Workaround for sql server dialect 2012 and up: add `ORDER BY` to your sql code, Hibernate will use the OFFSET-FETCH filter.