This is not about setMaxResults(), the problem is the query.setFirstResult(1); Hibernate 5 does only support query.setFirstResult(0) with the SQLServerDialect, any other value will lead to the documented exception. This was not the case in Hibernate 4, it supported query.setFirstResult() with SQLServerDialect. Its not something we can workaround easily, it is a clear regression to me. |